0

Basically I am using a CloudPage to update the customer event custom object in Salesforce CRM when a user clicks an ACTIVATE NOW button in the email.

Note:

The account is synched with CRM and I can retrieve other fields like FirstName, LastName and others so there is no integration issues. Also the custom field exists in CRM and I am using Customer_Event__c to retrieve the value.

Also the purpose is to update the Custom object with the specified value passed to CRM. For example, there will be campaigns like ABC123 set within the CRM and the CloudPage will look for the same campaign to update a contact within the CRM with an Opt-In status.

I am receiving error message when I try to retrieve the Customer Event field but I am able to get other values like FirstName and LastName without any error.

Below is the code used to retrieve the Customer Event in CloudPages:

%%[
SET @SubscriberKey = QueryParameter('subkey')

SET @LookUpCRM = RetrieveSalesforceObjects('Contact', 'Customer_Event__c', 'AccountId', '=', @SubscriberKey)
IF RowCount(@LookUpCRM) > 0 THEN
    SET @CRMRow = Row(@LookUpCRM,1) 
    SET @CustEvent = Field(@CRMRow, 'Customer_Event__c')
ELSE
    SET @CustEvent = 'Null'
ENDIF
]%%
  • Heeey Brad! Wuts up! Do you have the proper permissions setup in the CRM? Chris was saying that if you setup custom fields you may have to enable permissions. 1. What is custom event. Is it a field on contact object or on another object? 2. Do you have person accounts enabled? – Hamish Wilson Nov 27 '17 at 3:10
  • @HamishWilson I have resolved the issue. thanks anyway – Brad Sapkota Nov 27 '17 at 3:18
2

After some investigation, I was able to get the value from the custom object. Basically I was looking up customer event within the Contact object, and the proper way was to lookup within the custom object.

here is the solution code:

%%[
SET @LookUpCRM = RetrieveSalesforceObjects('Customer_Event__c','Name__c,Opt_In__c','Name__c','=','Test Event')
IF RowCount(@LookUpCRM) > 0 THEN
    SET @CRMRow = Row(@LookUpCRM,1) 
    SET @CustEvent = Field(@CRMRow, 'Name__c')
    SET @Optin = Field(@CRMRow, 'Opt_In__c')
ELSE
    SET @CustEvent = 'Null'
ENDIF
]%%
| 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.