thuphinguyen / php-dynamics-crm-2011

Automatically exported from code.google.com/p/php-dynamics-crm-2011
0 stars 0 forks source link

Enable use of the Update action #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Update action will allow the connector to send Updates to Entities.

Example XML:

<Update xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services">
            <entity xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                <b:Attributes xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
                    <b:KeyValuePairOfstringanyType>
                        <c:key>name</c:key>
                        <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">Fourth Coffee</c:value>
                    </b:KeyValuePairOfstringanyType>
                    <b:KeyValuePairOfstringanyType>
                        <c:key>accountid</c:key>
                        <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">8a7d7a68-6561-e111-b520-00155d021910</c:value>
                    </b:KeyValuePairOfstringanyType>
                    <b:KeyValuePairOfstringanyType>
                        <c:key>address1_postalcode</c:key>
                        <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">98052</c:value>
                    </b:KeyValuePairOfstringanyType>
                    <b:KeyValuePairOfstringanyType>
                        <c:key>address2_postalcode</c:key>
                        <c:value i:nil="true"/>
                    </b:KeyValuePairOfstringanyType>
                    <b:KeyValuePairOfstringanyType>
                        <c:key>revenue</c:key>
                        <c:value i:type="b:Money">
                            <b:Value>5000000</b:Value>
                        </c:value>
                    </b:KeyValuePairOfstringanyType>
                    <b:KeyValuePairOfstringanyType>
                        <c:key>creditonhold</c:key>
                        <c:value i:type="d:boolean" xmlns:d="http://www.w3.org/2001/XMLSchema">false</c:value>
                    </b:KeyValuePairOfstringanyType>
                </b:Attributes>
                <b:EntityState i:nil="true"/>
                <b:FormattedValues xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
                <b:Id>8a7d7a68-6561-e111-b520-00155d021910</b:Id>
                <b:LogicalName>account</b:LogicalName>
                <b:RelatedEntities xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
            </entity>
        </Update>

Note that further testing is required to determine the right format for Lookup 
fields; the GUID in this example is for the "accountid", which is the primary 
key of the Entity being updated.

Original issue reported on code.google.com by N.M.Pr...@gmail.com on 16 Mar 2012 at 2:03

GoogleCodeExporter commented 9 years ago
I'll handle this one.

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 2:09

GoogleCodeExporter commented 9 years ago

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 2:09

GoogleCodeExporter commented 9 years ago
Implemented and Tested

Original comment by N.M.Pr...@gmail.com on 19 Mar 2012 at 5:08