UpsertMscrmRecord

This function retrieves a single record from Microsoft Dynamics CRM, using the name and value pairs to filter the results. The function then sorts the results using the sort field and order provided. The process updates a found record with the applicable name and value pairs. If the process does not find a record, it creates one with all provided name and value pairs. This function returns the GUID of the updated or created record.

UpsertMscrmRecord(1, 2, 3, 4, 5, 6, 7, 8, 9)

OrdinalTypeDescription
1stringRequiredThe name of the Dynamics CRM entity for the record to upsert
2stringRequiredThe field used to sort the retrieve results
3stringRequiredThe order used to sort the retrieve results
4stringRequiredThe number of Name/Value pairs of fields used to retrieve
5stringaRequiredName of attribute to filter on the target entity
6stringRequiredValue of attribute to filter on the target entity
7stringRequiredThe number of Name/Value pairs of fields used to update
8stringaRequiredName of attribute to update on the target entity
9stringRequiredValue of attribute to update on the target entity

This example first checks to see if an account exists where the name equals “MarketingCloud”. If there is, it finds the one created most recently and sets the address1_city of that record to “Indianapolis.” If there isn’t, it creates a record where the name is “MarketingCloud” and the address1_city is “Indianapolis.”