0

Using LWC I made a custom progress bar in an attempt to replace the out of the box chevron progress bar tied to the Opportunity Stages for a Sales Process.

What I need to do next is find out what are the Opportunity Stages for the Sales Process and Record Type and which is the active StageName at the moment so I can display all that in my progress bar.

After researching I couldn't find a viable solution to do that. I thought that since it's 2020 there might have been an update in Salesforce since the last time this was asked for. If anybody has an idea of an easy way to achieve this I would love to hear it.

1

As @sfdcfox suggested, you need to use a few UI API wire adapters.

You'll need a combination of getRecord, getObjectInfo and getPicklistValues for a totally generic solution with no hardcoded Ids.

The good news is that I blogged exactly about that: https://developer.salesforce.com/blogs/2019/12/retrieving-picklist-values-without-using-apex.html

1
  • Thanks, that's what I was looking for! – Arthlete Mar 2 '20 at 18:22
3

You can use getPicklistValues to get the list of picklist values (filtered by record type), and getRecord to get the information off the opportunity record.

1
  • @sfdxfox Are we able to get the picklistvalues for all recordtypeIds(it is got from getobjectInfo call) in a single call? – vignesh Mar 2 '20 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.