• Misbah ul Iman
  • NEWBIE
  • 25 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
i  have been getting above error when i execute this code in develooper console 
 
List<orderItem> membs1 = [SELECT id FROM OrderItem WHERE orderid ='8017F000000CfJZ'];
  list <id> opids;
         
           
            for( orderItem OI : membs1)
            {
                opids.add(OI.id); 
             }
             system.debug('orde product ids r =='+ opids);

 
i  have been getting above error when i execute this code in develooper console 
 
List<orderItem> membs1 = [SELECT id FROM OrderItem WHERE orderid ='8017F000000CfJZ'];
  list <id> opids;
         
           
            for( orderItem OI : membs1)
            {
                opids.add(OI.id); 
             }
             system.debug('orde product ids r =='+ opids);

 
Hi,

I an getting below error:

Challenge Not yet complete... here's what's wrong: 
The 'accEdit' Lightning Component does not appear to be checking if 'v.recordSaveError' is true.

accEdit.cmp
 
<aura:component implements="flexipage:availableForRecordHome, force:hasRecordId"> <!--inherit recordId attribute-->

<aura:attribute name="record" type="Object" />
<aura:attribute name="accountRecord" type="Object" />
<aura:attribute name="recordSaveError" type="String" />

<force:recordData aura:id="recordEditor"
    layoutType="FULL"
    recordId="{!v.recordId}"
    targetError="{!v.recordSaveError}"
    targetRecord="{!v.record}"
    targetFields ="{!v.accountRecord}"
        fields="Name"          
    mode="EDIT" />

    <!-- Display a lightning card with details about the record -->
    <div class="Record Details"> 
        <lightning:card iconName="standard:account" title="{!v.accountRecord.Name}" >
            <div class="slds-p-horizontal--small">
                <p class="slds-text-heading--small">
                    <lightning:formattedText title="Billing State" value="{!v.accountRecord.BillingState}" /></p>
                <p class="slds-text-heading--small">
                     <lightning:formattedText title="Billing City" value="{!v.accountRecord.BillingCity}" /></p>
            </div>
        </lightning:card>
    </div>
    <br/>

    <!-- Display an editing form -->
    <div class="Record Details">
        <lightning:card iconName="action:edit" title="Edit Account">
            <div class="slds-p-horizontal--small">
                <lightning:input label="Account Name" value="{!v.accountRecord.Name}"/>
                <br/>
                <lightning:button label="Save Account" variant="brand" onclick="{!c.handleSaveRecord}" />
            </div>
        </lightning:card>
    </div>


    <aura:if isTrue="{!not(empty(v.recordSaveError))}">
		<br />

        Error: <ui:outputText value="{!v.recordSaveError}"/>

    </aura:if>
</aura:component>


accEditcontroller.js
({
    handleSaveRecord: function(cmp, event, helper) {
        cmp.find("recordEditor").saveRecord($A.getCallback(function(saveResult) {
            if (saveResult.state === "ERROR") {
                var errMsg = "";
                // saveResult.error is an array of errors, 
                // so collect all errors into one message
                for (var i = 0; i < saveResult.error.length; i++) {
                    errMsg += saveResult.error[i].message + "\n";
                }
                cmp.set("v.recordSaveError", errMsg);
            } else {
                cmp.set("v.recordSaveError", "");
            }
        }));}
})