0

I'm using propertybase to create contacts via salesforce (it uses apexrest REST API) and I followed this guide: https://help.propertybase.com/hc/en-us/articles/360003180752-WebToProspect-REST-API

I'm sucessfully creating contacts but I'm having problem with custom fields. When I try to save custom fields (that ends with __c, eg: Gender__c) I got no errorMessage but the contact is created with only the default fields populated (FirstName, Email, etc..). None of the custom ones are saved (there are text and pick list types, but none of them works).

The json for the request is something like that

{
  "prospect": {
    "token" : "tokenCode",
    "contact": {
      "FirstName": "A1Test",
      ... other default fields
      "Gender__c": "Male",
      ...other custom fields
    },
    "contactFields": [
      "FirstName",
      ...
      "Gender__c",
      .....
    ]
  } 
}

Should I change something in the request? Can someone help with that?

1
  • 1
    The documentation you linked to does contain a suggestion: Why are my fields not populating? Make sure that the Object Field Permissions have been granted to the webservice user. See the "Anonymous Call" tab on this page for instructions on granting Object Field Permissions.
    – Derek F
    Oct 25, 2022 at 16:38

2 Answers 2

0

Thanks @Derek, I had enabled the read/write permission of the fields when I created them but when I went to Object Settings the checkbox weren't marked for the fields. So it was just checkin them there and I could save the data.

1
  • Another note: If you create fields in one org and then deploy them to another org, the FLS (field level security) does not get transferred, and they need to be explicitly set in the new org (unless you're using Permission Sets, which can be (easily) deployed between orgs).
    – Derek F
    Oct 26, 2022 at 14:09
0

It seems need to use fieldName and label end with "__c".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .