2

Need a small help on figuring out what I'm missing in my XML to retrieve all the fields in Case and Opportunity. So far i manage to get almost all but there is 2 standard fields that i can't pull.

In Case it is the BusinessHoursId and in Opportunity it is Probability. I'm not sure what is missing but i set all the standard retrieve calls for all objects but this 2 fields just cant be pulled.

Any idea what I'm missing.

The package.xml

<?xml version="1.0" encoding="UTF-8"?> <Package> xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
    <members>Account</members>
    <members>Asset</members>
    <members>Asset</members>
    <members>Campaign</members>
    <members>Case</members>
    <members>CaseMilestone</members>
    <members>Coaching</members>
    <members>Contact</members>
    <members>Contract</members>
    <members>ContractLineItem</members>
    <members>Document</members>
    <members>DuplicateRecordSet</members>
    <members>Entitlement</members>
    <members>Entitlement</members>
    <members>EntitlementContact</members>
    <members>Feedback</members>
    <members>FeedbackQuestion</members>
    <members>FeedbackQuestionSet</members>
    <members>FeedbackRequest</members>
    <members>FeedbackTemplate</members>
    <members>Goal</members>
    <members>GoalCollaborator</members>
    <members>GoalLink</members>
    <members>Idea</members>
    <members>Lead</members>
    <members>Macro</members>
    <members>Opportunity</members>
    <members>OpportunityStage</members>
    <members>Order</members>
    <members>PerformanceCycle</members>
    <members>PriceBook2</members>
    <members>Product2</members>
    <members>PushTopic</members>
    <members>ServiceContract</members>
    <members>Solution</members>
    <members>StreamingChannel</members>
    <members>Task</members>
    <members>User</members>
    <members>WorkCoaching</members>
    <members>WorkFeedback</members>
    <members>WorkFeedbackQuestion</members>
    <members>WorkFeedbackQuestionSet</members>
    <members>WorkFeedbackRequest</members>
    <members>WorkFeedbackTemplate</members>
    <members>WorkGoal</members>
    <members>WorkGoalCollaborator</members>
    <members>WorkGoalLink</members>
    <members>WorkPerformanceCycle</members>
    <name>CustomObject</name>
</types>
<types>
    <members>Account</members>
    <members>Asset</members>
    <members>Campaign</members>
    <members>Case</members>
    <members>Coaching</members>
    <members>Contact</members>
    <members>Contract</members>
    <members>ContractLineItems</members>
    <members>Document</members>
    <members>DuplicateRecordSet</members>
    <members>Entitlement</members>
    <members>Entitlement</members>
    <members>EntitlementContact</members>
    <members>Feedback</members>
    <members>FeedbackQuestion</members>
    <members>FeedbackQuestionSet</members>
    <members>FeedbackRequest</members>
    <members>FeedbackTemplate</members>
    <members>Goal</members>
    <members>GoalCollaborator</members>
    <members>GoalLink</members>
    <members>Idea</members>
    <members>Lead</members>
    <members>Macro</members>
    <members>Opportunity</members>
    <members>Order</members>
    <members>PerformanceCycle</members>
    <members>PriceBook2</members>
    <members>Product2</members>
    <members>PushTopic</members>
    <members>ServiceContract</members>
    <members>Solution</members>
    <members>StreamingChannel</members>
    <members>WorkCoaching</members>
    <members>WorkFeedback</members>
    <members>WorkFeedbackQuestion</members>
    <members>WorkFeedbackQuestionSet</members>
    <members>WorkFeedbackRequest</members>
    <members>WorkFeedbackTemplate</members>
    <members>WorkGoal</members>
    <members>WorkGoalCollaborator</members>
    <members>WorkGoalLink</members>
    <members>WorkPerformanceCycle</members>
    <name>CustomTab</name>
</types>
<types>
    <members>*</members>
    <name>Group</name>
</types>
<types>
    <members>*</members>
    <name>PermissionSet</name>
</types>
<types>
    <members>Case</members>
    <members>Opportunity</members>
    <name>Picklist</name>
</types>
<types>
    <members>*</members>
    <name>Profile</name>
</types>
<types>
    <members>*</members>
    <name>ProfileLoginIpRange</name>
</types>
<types>
    <members>Case</members>
    <members>Opportunity</members>
    <members>Task</members>
    <name>RecordType</name>
</types>
<types>
    <members>*</members>
    <name>SharingCriteriaRule</name>
</types>
<types>
    <members>*</members>
    <name>networkAccess</name>
</types>
<types>
    <members>*</members>
    <name>passwordPolicies</name>
</types>
<types>
    <members>*</members>
    <name>userPermissions</name>
</types>
<types>
    <members>*</members>
    <name>Settings</name>
</types>
<version>32.0</version> </Package>

i also tried to add the following in but did not do anything

<types>
        <members>Case.BusinessHoursId</members>
        <members>Opportunity.Probability</members>
        <name>CustomField</name>
</types>

any help would be great.

Thanks. Jason

  • Does the user profile of the user sending the API queries have access to those fields? – Daniel Ballinger May 20 '15 at 2:51
  • yes they do, i cant even see it when i pull the admin profile. – Jason May 20 '15 at 2:54
  • 1
    So the SOQL query Select Id, Probability from Opportunity in the developer console returns data for the given user. Just ruling this out as a possible cause first. – Daniel Ballinger May 20 '15 at 3:01
  • i think i missed one point, what i am trying to do i build a metadata for permission set to be loaded to the org so i dont have to redo it all the time for my project. so when i use workbench to retrieve the metadata this 2 field are not showing up. sorry for not noting that in the questing part – Jason May 20 '15 at 3:04
2

Are you sure the user you're using has access to those fields? I just tried to retrieve those fields, and here's the result.

Case.object:

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <fields>
        <fullName>BusinessHoursId</fullName>
        <trackFeedHistory>false</trackFeedHistory>
        <trackHistory>false</trackHistory>
        <trackTrending>false</trackTrending>
        <type>Lookup</type>
    </fields>
</CustomObject>

Opportunity.object:

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <fields>
        <fullName>Probability</fullName>
        <trackFeedHistory>false</trackFeedHistory>
        <trackTrending>false</trackTrending>
    </fields>
</CustomObject>

package.xml:

<types>
    <members>Case.BusinessHoursId</members>
    <members>Opportunity.Probability</members>
    <name>CustomField</name>
</types>

So as you can see, they are retrieved correctly.

Also, if you're only retrieving fields then you don't need to specify any CustomObject members. Retrieving the fields will create the relevant .object files.

  • Hi Davin, in the object it exist but in the profile or permission set it does not. – Jason May 20 '15 at 9:31
  • Are you retrieving the profile / permission set in the same transaction i.e. are they also part of the same package.xml? – Davin Casey May 20 '15 at 9:46
  • that is correct, i'm pulling objects with profile and permission set in the package.xml – Jason May 20 '15 at 10:42
  • So then you should see the profile & permission set files appear in your src directly under profiles/ and permissionsets/ (I think they're the folder names). Inside these files should be the permissions relating to the custom fields. – Davin Casey May 20 '15 at 10:53
  • i get all the fields except those 2 for profile and permission set. even the admin profile does not show that field, and yes the profile has access to the field. – Jason May 20 '15 at 10:57

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.