• Saurabh Agarwal 32
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hello,

I have below lightning markup which should display value of a record from LDS.
<aura:component  implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    <aura:attribute name="boatId" type="ID" access="public"/>
    
    <aura:attribute name="record" type="Boat__c" description="The record object to be displayed" access="public"/>
<aura:attribute name="simpleRecord" type="Object" description="A simplified view record object to be displayed" access="public"/>
    <aura:attribute name="recordError" type="String" description="An error message bound to force:recordData" access="public"/>

	Boat details are here for {!v.boatId}
       <force:recordData aura:id="service"
                  recordId="{!v.boatId}"
                   fields="Id,Name"
                   mode="VIEW"
                   targetFields="{!v.record}"
                  
                   targetError="{!v.recordError}"
                    />
    <br/>{!v.record.Name} should come
   
    

</aura:component>
In above code the below line properly displays the id of object.
Boat details are here for {!v.boatId}

But the <force:recordData> does not display the below line.
{!v.record.Name} should come

However in same code if I hardcode the Id of object record as below, it works.
recordId="a061H00000aQlGsQAK"


 
Hello,

I want to update picklist values in edit form based on values available in table.
My VF page looks like :
<apex:selectList value="{! Contact.assign_1_Business_Vertical__c }" multiselect="true" size="5">
                <apex:selectOptions value="{!parentPicklistOptions}"  />
                <apex:actionSupport event="onchange"  rerender="panel2,panel3" />
            </apex:selectList>
My controller is :
public List<SelectOption> getParentPicklistOptions() {
        List<SelectOption> selectOpts = new List<SelectOption>();
        for ( String s : parentDepMap.keySet() )
            selectOpts.add(new SelectOption(s, s));
      System.debug(contact.assign_1_Business_Vertical__c);
          Contact.assign_1_Business_Vertical__c = 'Finance';
          
        return selectOpts;
    }

I can only preset any one value as you can see from apex above where i selected 'Finance'.
I came to know from other forum topics that I can setup a getter setter for values variable of VF page in apex. and there the data type should be String array.
But in my case I am using standerd database field as Value variable in Vf page.
<apex:selectList value="{! Contact.assign_1_Business_Vertical__c }" multiselect="true" size="5">

How can I prepopulate multiple values in this scenario.

 
Hello,

When I click on "Check Challenge" I get below error :
Looks like we're having issues, please try again. If this issue persists, please contact us using the submit feedback section on the sidebar.
Hello,

When I click on "Check Challenge" I get below error :
Looks like we're having issues, please try again. If this issue persists, please contact us using the submit feedback section on the sidebar.
Hello,

I have below lightning markup which should display value of a record from LDS.
<aura:component  implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    <aura:attribute name="boatId" type="ID" access="public"/>
    
    <aura:attribute name="record" type="Boat__c" description="The record object to be displayed" access="public"/>
<aura:attribute name="simpleRecord" type="Object" description="A simplified view record object to be displayed" access="public"/>
    <aura:attribute name="recordError" type="String" description="An error message bound to force:recordData" access="public"/>

	Boat details are here for {!v.boatId}
       <force:recordData aura:id="service"
                  recordId="{!v.boatId}"
                   fields="Id,Name"
                   mode="VIEW"
                   targetFields="{!v.record}"
                  
                   targetError="{!v.recordError}"
                    />
    <br/>{!v.record.Name} should come
   
    

</aura:component>
In above code the below line properly displays the id of object.
Boat details are here for {!v.boatId}

But the <force:recordData> does not display the below line.
{!v.record.Name} should come

However in same code if I hardcode the Id of object record as below, it works.
recordId="a061H00000aQlGsQAK"


 
Hello,

I want to update picklist values in edit form based on values available in table.
My VF page looks like :
<apex:selectList value="{! Contact.assign_1_Business_Vertical__c }" multiselect="true" size="5">
                <apex:selectOptions value="{!parentPicklistOptions}"  />
                <apex:actionSupport event="onchange"  rerender="panel2,panel3" />
            </apex:selectList>
My controller is :
public List<SelectOption> getParentPicklistOptions() {
        List<SelectOption> selectOpts = new List<SelectOption>();
        for ( String s : parentDepMap.keySet() )
            selectOpts.add(new SelectOption(s, s));
      System.debug(contact.assign_1_Business_Vertical__c);
          Contact.assign_1_Business_Vertical__c = 'Finance';
          
        return selectOpts;
    }

I can only preset any one value as you can see from apex above where i selected 'Finance'.
I came to know from other forum topics that I can setup a getter setter for values variable of VF page in apex. and there the data type should be String array.
But in my case I am using standerd database field as Value variable in Vf page.
<apex:selectList value="{! Contact.assign_1_Business_Vertical__c }" multiselect="true" size="5">

How can I prepopulate multiple values in this scenario.