0
votes

In MuleSoft for Salesforce Upsert connector how to pass allOrNone=true ?

I tried below but no luck , I see that allOrNone works for composite but any idea how to make it work for upsert as well ?

<salesforce:upsert doc:name="Upsert" doc:id="f97aa678-222f-4c4d-819d-95217c656ff2" config-ref="Salesforce_Config" objectType="Product2" externalIdFieldName="SAP_Material_Number__c">
            <salesforce:headers >
                <salesforce:header key='allOrNone' value="true" />
            </salesforce:headers>
        </salesforce:upsert>
1

1 Answers

0
votes

I just found a way and its working. This might help others

  <ee:transform doc:name="Transform Message" doc:id="ff880d6c-9b98-4853-a303-986a63cca156" >
            <ee:message >
                <ee:set-payload ><![CDATA[%dw 2.0
output application/java
---
payload]]></ee:set-payload>
            </ee:message>
            <ee:variables >
                <ee:set-variable variableName="allOrNone" ><![CDATA[%dw 2.0
output application/java
---
{
    allOrNone:true
}]]></ee:set-variable>
            </ee:variables>
        </ee:transform>
        <salesforce:upsert doc:name="Upsert" doc:id="f97aa678-222f-4c4d-819d-95217c656ff2" config-ref="Salesforce_Config" objectType="Product2" externalIdFieldName="SAP_Material_Number__c">
            <salesforce:headers >
                <salesforce:header key='AllOrNoneHeader' value='#[vars.allOrNone]'/>
            </salesforce:headers>
        </salesforce:upsert>