1

I am retrieving Lead information through the metadata API and the business processes that come with it do not match what is in the org.

I have verified the org I am retrieving from is correct. I also noticed if I deploy these included values to the org it doesn't actually update the lead process either.

Why are these values being included?

Correct Values:

enter image description here

Actual Values being retrieved:

<?xml version="1.0" encoding="UTF-8"?>
<BusinessProcess xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Offline Lead Process</fullName>
    <isActive>true</isActive>
    <values>
        <fullName>Closed - Aged</fullName>
        <default>false</default>
    </values>
    <values>
        <fullName>Closed - No Interest</fullName>
        <default>false</default>
    </values>
    <values>
        <fullName>Contact Attempted</fullName>
        <default>false</default>
    </values>
    <values>
        <fullName>Currently Engaged</fullName>
        <default>false</default>
    </values>
    <values>
        <fullName>Nurture - Future Fit</fullName>
        <default>false</default>
    </values>
    <values>
        <fullName>Open</fullName>
        <default>true</default>
    </values>
    <values>
        <fullName>Qualified - Convert</fullName>
        <default>false</default>
    </values>
    <values>
        <fullName>Qualified - Currently Engaged</fullName>
        <default>false</default>
    </values>
    <values>
        <fullName>Unqualified</fullName>
        <default>false</default>
    </values>
    <values>
        <fullName>Unqualified - Bad Data</fullName>
        <default>false</default>
    </values>
    <values>
        <fullName>Unqualified - No Fit</fullName>
        <default>false</default>
    </values>
</BusinessProcess>

The additional values being included are inactive Lead Status Values

Active Values:

enter image description here

Edit

I ended up just deleting the inactive values and they no longer get retrieved. I am still unsure of the cause though.

  • What API version are you using, out of curiosity? – David Reed Nov 20 '19 at 19:54
  • @DavidReed version 47 – TemporaryFix Nov 20 '19 at 19:58
1

If I understood correctly, this happens because the business process includes all the picklist values for the LeadStatus standard picklist. It ignores the fact that they are enabled or not. The business process metadata lists the fields as the PicklistValue type, but it does not include the isActive attribute of the values (this attribute is included on the LeadStatus field metadata though).

When you deploy the metadata back into the org it doesn't change because there are inactive values in the LeadStatus picklist. If you activate them, then the active values will appear in your org's business process.

From the Picklist metadata doc, on the isActive attribute description:

... Users can select only active values from a picklist. ...

Which can explain you see the filtered list of values on the business process interface.

|improve this answer|||||
  • We have a pretty long list of inactive values and not all show up, why would only a handful show? – TemporaryFix Nov 20 '19 at 22:14
  • I didn't know there was a long list, your comment says that "the additional values" are inactive statuses values. What do you mean "only a handful show"? Show up where? On the file or on the interface? – Renato Oliveira Nov 20 '19 at 22:23
  • 1
    The additional values are a subset inactive values. Why would only that subset of inactive values show in the process file and not all inactive values along with all active values. – TemporaryFix Nov 20 '19 at 22:24
  • That's a good question. Now I'm not so sure, but it could be that you have some other component in your metadata that references those values? – Renato Oliveira Nov 20 '19 at 22:47

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.