• Timothy Wong 2
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi
I am having trouble to set the default value for the dependent picklist in lightning by using the createRecordEvent + defaultFieldValues. I have a custom button to create new opportunity and it will grab data from account and pre-fill in opportunity. Everything works except the dependent picklist and seem like the field is lock in lightning and I can't figure a way to pre-select the value for the user. And the dependent picklist is a required field so the user has to fill in something so workflow may not be ideal for this case. Does anyone has any ideas? Please help!!

            createRecordEvent.setParams({
                "entityApiName": "Opportunity",
                "recordTypeId":rtDet.id,
                "defaultFieldValues": {
                    'AccountId' : Account.Id ,
                    'CurrencyIsoCode' : Account.CurrencyIsoCode,
                    'Type' : OpportunityType,
                    'City__c' : Account.City__c,
                    'Region__c' : Account.Region_n__c
                }
            });
Hi
I am having trouble to set the default value for the dependent picklist in lightning by using the createRecordEvent + defaultFieldValues. I have a custom button to create new opportunity and it will grab data from account and pre-fill in opportunity. Everything works except the dependent picklist and seem like the field is lock in lightning and I can't figure a way to pre-select the value for the user. And the dependent picklist is a required field so the user has to fill in something so workflow may not be ideal for this case. Does anyone has any ideas? Please help!!

            createRecordEvent.setParams({
                "entityApiName": "Opportunity",
                "recordTypeId":rtDet.id,
                "defaultFieldValues": {
                    'AccountId' : Account.Id ,
                    'CurrencyIsoCode' : Account.CurrencyIsoCode,
                    'Type' : OpportunityType,
                    'City__c' : Account.City__c,
                    'Region__c' : Account.Region_n__c
                }
            });