function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
phyroslamphyroslam 

INVALID_FIELD_FOR_INSERT_UPDATE

I´m using API to create a case, this is the code I´m using:


$FIELDS = array('type'=>'Case');

$FIELDS['ContactId'] = $contact;
$FIELDS['AssetId'] = $asset;
$FIELDS['RecordTypeId'] = '0123000000005tA';
$FIELDS['Subject'] = 'SUBJECT';




$result = $client->create($FIELDS);

This is the error I´m geting this error:

[fields] => AssetId [message] => bad field names on insert/update call: AssetId [statusCode] => INVALID_FIELD_FOR_INSERT_UPDATE


But When I use the following code I get no errors and the case is created:


$FIELDS = array('type'=>'Case');

$FIELDS['ContactId'] = $contact;
//$FIELDS['AssetId'] = $asset;
$FIELDS['RecordTypeId'] = '0123000000005tA';
$FIELDS['Subject'] = 'SUBJECT';




$result = $client->create($FIELDS);


How can I creat a case related to a contact and to an asset?
Eugene KapustinEugene Kapustin
Hello,

Probably your assetid is not valid id. Make sure you are using correct existing assetid.

Thank you,
Eugene