I have a custom field for contacts that I would like to retrieve the value for using JavaScript.
Using the API explorer I have generated the code that does this. It works PERFECTLY from the API explorer (which uses PHP).
However, when I run the Javascript code in my extension I get an error. Here is the code:
CRM.api3('Contact', 'getvalue', {
"sequential": 1,
"return": ["custom_102"], //custom_fieldId
"id": 2 // contact id
}).done(function(result) {
// do something
});
Here is the error:
Object {
invalid_field: Array[1],
is_error: 1,
error_message: "field Array unset or not existing" }
error_message : "field Array unset or not existing"
invalid_field : Array[1]
0 : "custom_102"
I am at a complete loss here... and would really appreciate some help!