You need to sign in to do that
Don't have an account?
Timothy Wong 2
lightning set default value for dependent picklist
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
}
});
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
}
});
OR
I didn't make myself clear. I can't pre-fill "any" dependance picklist with defaultFieldValues. Nothing to do with the code, not even hardcoded with "'Region__c' : 'North America'"