You need to sign in to do that
Don't have an account?
Adam Pietraszek
Set picklist value on in custom field on opportunity page with custom buttons on Lightning Component
I've taken over our org from the previous dev and even though I'm not a developer (I'm the admin) I need to fix this issue. I have limited dev experience but I figured I'll give this a shot.
We are using lightning components for our opportunities. We also have a few custom fields on the page layout as well in addition to the lightning component.
The lightning component has a custom button that changes the stages of the opportunity.
I would like to add a line of code to that button that will also change the value of one of the custom picklists. This picklist does not exist in the lightning component - it's just a custom field on the layout itself.
The button click action is on the ComponentHelper.js so I'm adding the line there but I'm having issues.
The custom field is Demo_Audit_Status__c so I thought the line of code would be:
We are using lightning components for our opportunities. We also have a few custom fields on the page layout as well in addition to the lightning component.
The lightning component has a custom button that changes the stages of the opportunity.
I would like to add a line of code to that button that will also change the value of one of the custom picklists. This picklist does not exist in the lightning component - it's just a custom field on the layout itself.
The button click action is on the ComponentHelper.js so I'm adding the line there but I'm having issues.
The custom field is Demo_Audit_Status__c so I thought the line of code would be:
component.set("Demo_Audit_Status__c", "No Demo Needed");I'm pretty sure I'm oversimplifying what I need but I'd rather fix this before having to reach out to the original devs.
With the given information , i am assuming below piece of code is used to set the field values.If this is the method that called inside button Then add the following line of code.That might do the trick.
FROM:
TO:
Hope this helps!
Regards,
Santosh.
All Answers
Please share your controller code to get more insight.That woould be helpful in resolving your issue.
With the given information , i am assuming below piece of code is used to set the field values.If this is the method that called inside button Then add the following line of code.That might do the trick.
FROM:
TO:
Hope this helps!
Regards,
Santosh.
This is the button I'm actually looking for:
However the code you gave me doens't actually alter the field.
I just want to make sure I'm being clear. The object I'm working in is Opportunity. The lightning component is also displayed on the Opportunity layout. And the Demo Audit Status is a custom field on the Opportunity object and layout, NOT in the lightning component.
works as I expect it to. thanks everyone.
Hi Adam,
If its helpful, please mark my answer as the best answer. That way someone else with similar issue can benefit and i can get few points too.Glad was able to help you fix your issue.
Regards,
Santosh