1

I'm creating a custom profile page and I want to save some information in a custom object in Salesforce. How would I go about doing this? I assume I would be using SSJS rather than AMPscript. Thanks in advance, appreciate any pointers.

2

AMPscript would definitely be the way to go, assuming you have Marketing Cloud Connect configured. There are different AMPscript functions for creating and updating records in standard or custom objects.

Create New Record

var @createRecord
set @createRecord = CreateSalesforceObject(
      "MyCustomObjectApiName__c", 3,
      "field1__c", @field1,
      "field2__c", @field2,
      "field3__c", @field3
   )

Update Existing Record

var @updateRecord
set @updateRecord = UpdateSingleSalesforceObject(
    "MyCustomObjectApiName__c", @Id,
    "field1__c", @field1,
    "field2__c", @field2,
    "field3__c", @field3
   )

Refer to Sales and Service Cloud functions documentation for details on which arguments to use with these functions.

| improve this answer | |
0

@nicolevy try like this for creating new record in Custom object

%%[ 
  set @createrec=CreateSalesforceObject('customobject', 2, 'Field1', 'value1, 'field2', 'value2')

   ]%%
| improve this answer | |

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.