1

Why Cant we access the MilestoneStatus field either on the Workflow or Process Builder or in formula field ?

As per current implementation, my Case Detailed page is pure custom and I have Entitlement Processes and Milestones in place. The thing is that I cant access the Milestone Status Icon field, but I can access the MilestoneStatus value. That value I need to populate into Custom Milestone Status Icon and using formula field I wants to show the Milestone Status Icon.

How can I approach to this implementation ?

I got the reference here : https://help.salesforce.com/articleView?id=000171150&language=en_US&type=1

But how can I populate custom picklist field if I dont have access to Milestone Status field using Workflow, PB etc?

Note: I have almost 5 Milestones on each entitlement processes and almost 40 Entitlement Processes. I only need to used OOTB MilestoneStatus which gets calculate the value automatically that value I wants to populate to different field and formula field will just show the correct Icon.

Can we implement using Queueable interface?

4
+25

As it's explained in the Knowledge Article Case.MileStonestatus is a very special field, populated and treated differently as most other fields in Salesforce. Schema reports the field as String(30).

Even if it is displayed in Setup, in my tests (Execute Anonymous Context) it seems not to be accessible by Apex

Case c = new Case();
c.Subject='test';
c.MilestoneStatus = 'test';
insert c;

Variable does not exist: MilestoneStatus

Nor is it available in SOQL queries

[ select Id, MilestoneStatus from Case limit 1 ]

No such column 'MilestoneStatus' on entity 'Case'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

So implementing the Queueable interface is unlikely to work.

The Knowledge Article recommends

Workaround:

Have a picklist field (e.g. Status or a custom picklist field) that can be populated dynamically basing on the Milestone Status Value. After having the picklist field, create a formula field that will set the value same as the Milestone Status basing on the Picklist value that has been set.

Example: If your case status = abc and this is the criteria for milestone a, then you code your formula field to return a value of milestone a if the status = abc.

Now my interpretation of this is that you are encouraged to implement an independent formula field which is mimicking the result of MilestoneStatus. But like you I find this workaround worded not very clearly and hard to understand. Salesforce should have provided a real example with the actual code of the formula to avoid misunderstandings and guesswork.

| improve this answer | |
  • I was already aware about this workaround mentioned over web. My only ask "Have a picklist field (e.g. Status or a custom picklist field) that can be populated dynamically basing on the Milestone Status Value" - How we can actually do this ? Any code ? Any thought ? How practically its possible ? – Ash_P Oct 2 '17 at 16:15
  • As said above it looks almost impossible, while the interpretation of the Salesforce workaround is hard. What I understand is that you should rebuild (mimic, duplicate) the entire MilestoneStatus criteria in a formula. Hardly viable I guess. – Uwe Heim Oct 2 '17 at 16:30
  • You're right I guess, in my org I have almost 40 Entitlement Processes and 120 milestones, still I see impossible solution. I dont see any viable solution and seems salesforce limitations. I was not able to show to client what I had promissed. – Ash_P Oct 2 '17 at 16:33
  • Maybe replicating the entire mechanism by Workflow, ProcessBuilder or Apex Trigger could help - however it would require a deep overhaul of what you got so far. I can't figure a Formula can do it because of its limitations. – Uwe Heim Oct 2 '17 at 16:41
  • What else I can show is that only the Milestone Status and not the Milestone Status Icon. – Ash_P Oct 2 '17 at 16:52

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.