Reputation: 138
I am following this to fetch the fields records from salesforce and its working fine with Contact as sf_fields returns the contact fields e.g. Name, Email with lambda test.
{
"Details": {
"Parameters": {
"sf_operation" : "phoneLookup",
"sf_phone" : "[ENTER PHONE NUMBER HERE]",
"sf_fields" : "Id, Name, Email"
}
}
}
but it is not working with Account, i want to get the Account fields. How to replace Account with Contact to get fields value of Account.
When i tried to get the fields of Accounts it returns this error:
"errorMessage": "INVALID_FIELD: No such column 'City_CB__c' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.",
"errorType": "Exception"
Upvotes: -1
Views: 736
Reputation: 19622
Salesforce Phone Lookup
This operation is invoked by setting sf_operation to phoneLookup. In this case, the Lambda function uses Salesforce Object Search Language (SOLS) to construct text-based search queries. For phoneLookup, the following parameters are required: sf_phone sf_fields
SOSL is a full-text search, similar to the search box you see at top of the page in Salesforce. You'd need to put a debug log in Salesforce to see what exactly happens but I suspect it runs something similar to FIND {123} IN PHONE FIELDS RETURNING Contact (Id, Name, Phone, Email)
. Looks like in this function there's no "room" to specify you want results from Account. You may get some Accounts if they have matching phones but that's about it.
Instead experiment with "salesforce search" or "salesforce query one" on that documentation page? There are examples that fetch Cases and Task, should be enough to get you started.
Upvotes: 1