Hi Shanika,

This sample code [1] snippets would be useful to configure the salesforce
update.

[1] Sample code

<?xml version="1.0" encoding="UTF-8"?>
<sequence name="updateSalesforce" trace="disable" xmlns="
http://ws.apache.org/ns/synapse";>
    <salesforce.init configKey="SFConfig"/>
    <payloadFactory media-type="xml">
        <format>
            <sfdc:sObjects type="Account" xmlns:sfdc="sfdc">
                <sfdc:sObject>
                    <sfdc:Id>$1</sfdc:Id>
                    <sfdc:Name>$2</sfdc:Name>
                </sfdc:sObject>
            </sfdc:sObjects>
        </format>
        <args>
            <arg evaluator="xml" expression="get-property('id')" xmlns:ns="
http://org.apache.synapse/xsd"/>
            <arg evaluator="xml" expression="get-property('name')"
xmlns:ns="http://org.apache.synapse/xsd"/>
        </args>
    </payloadFactory>
    <salesforce.update>
        <allOrNone>{$ctx:allOrNone}</allOrNone>
        <allowFieldTruncate>{$ctx:allowFieldTruncate}</allowFieldTruncate>
        <sobjects xmlns:sfdc="sfdc">{//sfdc:sObjects}</sobjects>
    </salesforce.update>
</sequence>

Regards
Hasunie

On Wed, Mar 28, 2018 at 2:52 PM, Shakila Sasikaran <[email protected]> wrote:

> Hi Shanika,
>
> It is a JSON object which contains the field name and the value pair. For
> example, if you are going to update the Account object in Salesforce, you
> have to pass it as follows.
>
> {
>     "name":"Sample Account Obj",
>     "description":"This account is for testing"
> }
>
> Thanks
>
> On Wed, Mar 28, 2018 at 1:00 PM, Shanika Nishani <[email protected]>
> wrote:
>
>> Hi Devs,
>>
>>
>> I'm trying to update Account object in Salesforce with the use of WSO2
>> salesforce rest API connector.as per the documentation it is as follow
>>
>> <salesforcerest.update>
>>     <sObjectName>{$ctx:sObjectName}</sObjectName>
>>     <fieldAndValue>{$ctx:fieldAndValue}</fieldAndValue>
>>     <Id>{$ctx:Id}</Id>
>> </salesforcerest.update>
>>
>> does anyone have an idea what should be the format for *fieldAndValue*.
>> I have tried giving the attribute tag and the value.But it fails.
>>
>> Best Regards,
>>
>> Shanika Nishani
>>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Shakila Sasikaran
> Software Engineer
> Mobile :+94 (0) 77 526 6848 <+94%2077%20526%206848>
> [email protected]
> WSO2, Inc.
> lean . enterprise . middleware
> http://www.wso2.com/
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Hasunie Adikari*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
blog http://hasuniea.blogspot.com | https://medium.com/@Hasunie/
Mobile:+94713095876
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to