1

EDIT:

Error received:

{"message":"Call to retrieve records for salesforceobject Contact failed! Error in the application.\nAPI Fault: Salesforce.com Fault thrown.\n\tException Type:InvalidFieldFault\n\tException Code:INVALID_FIELD\n\tException Message:\nSELECT Id FROM Contact WHERE Phone = '16066582276'\n ^\nERROR at Row:1:Column:30\nfield 'Phone' can not be filtered in a query call\n\tAt row:1 and column: 30","description":"ExactTarget.OMM.FunctionExecutionException: Call to retrieve records for salesforceobject Contact failed! Error in the application.\nAPI Fault: Salesforce.com Fault thrown.\n\tException Type:InvalidFieldFault\n\tException Code:INVALID_FIELD\n\tException Message:\nSELECT Id FROM Contact WHERE Phone = '16066582276'\n ^\nERROR at Row:1:Column:30\nfield 'Phone' can not be filtered in a query call\n\tAt row:1 and column: 30\r\n Error Code: RETRIEVESFOJBECTS_FUNC_ERROR\r\n - from Jint\r\n\r\n"} Row Count:

I have a Cloud Page for testing - eventually, this code will wind up in a Mobile Connect "STOP" message.

Code:

%%[
    set @rs = RetrieveSalesforceObjects('Contact', 'Id', 'Phone', '=', '6061234567')
    set @rowCount = RowCount(@rs)
]%% 

I verified that this phone number exists in the CRM (Service Cloud) AND in the sync'd Data Extensions (Contact object) and we have it connected to Marketing Cloud. However when I run this and I output @rowCount to the screen, it ends up being a 500 error. However when I change the above code to this:

%%[
    set @rs = RetrieveSalesforceObjects('Contact', 'Id', 'Name', '=', 'John')
    set @rowCount = RowCount(@rs)
]%% 

This brings back several rows.

This is my first time really messing with the API calls to Salesforce from Marketing Cloud. What could I be doing wrong?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.