• Chetan Bhavsar
  • NEWBIE
  • 5 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies

I ttied "Create a Lightning Component to display a single item for your packing list." on trail rail

but i encountered "The campingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly." error 

could anyone give me hint?

my answer for this challenge is following.

<aura:component>
    <aura:attribute name="item" type="Camping_Item__c"/>
    <p>Name:
        <ui:outputText value="{!v.item.Name}"/>
    </p>
    <p>Price:
        <ui:outputCurrency value="{!v.item.Price__c}"/>
    </p>
    <p>Quantity:
        <ui:outputNumber value="{!v.item.Quantity__c}"/>
    </p>
    <p>Packed:
        <ui:outputCheckbox value="{!v.item.Packed__c}"/>
    </p>
</aura:component>
 

Hi team,
 
sforce.apex.execute not working , i found no such property in object when i printed sforce and navigated into it. In lot of forms many people mentioned to use sforce.apex.execute to invoke apex class in visualforce page.

The following are the references i added . 

<apex:includeScript value="https://ap2.salesforce.com/soap/ajax/34.0/apex.js"/> <apex:includeScript value="https://ap2.salesforce.com/soap/ajax/34.0/connection.js"/>

and in the visualforce page i added below code  in the <script> tag


var retStr='';       
        console.log(sforce);
        retStr = sforce.apex.execute("RequestData", "getData",{}); 

I am using chrome to work.
Did this feature got discontinued.
My purpose is to invoke an apex code from the visualforce page.

 

I'm want to write some JS in a custom button to update the status field of the current object. I found some example code that seems to do what I want, but I'm getting an error when performing the update.

 

http://pastebin.com/MQdFdFde

 

The error I'm getting is: Refused to set unsafe header "User-Agent"

I get this error when I try to update SF with result = sforce.connection.update(updateRecords);

 

Any tips?

  • July 25, 2011
  • Like
  • 0