Hi,
I am trying to create a new account in CRM Sandbox by using SDK, and in the process would like to set a parent account as well:
But what happens at the end of account creation -- I get the following:
An empty string or empty array?
What I did:
a. I fetched the parent account:
- $accountParent = Record::getRecordUsingExternalId($this->customerId, 'Accounts')->getObject()->getData()[0]; // returns the expected class com\zoho\crm\api\record\Record
b. I set the accounts attribute ParentAccount and created a record
- $record1->addFieldValue(Accounts::AccountName(), $accountName); // test12
- $record1->addFieldValue(Accounts::ParentAccount(), $accountParent); // an object with keyValues[] and keyModified[]
- return $recordOperations->createRecords($moduleAPIName, $bodyWrapper);
d. I digged a little bit in your code and
- $convertInstance = $this->getConverterClassInstance(strtolower($this->contentType));
- $requestObject = $convertInstance->formRequest($this->request, get_class($this->request), null, null);
Line 1 has the right data, but line 2 has an empty array for Account Parent
Can you please help me out here? Did I do eveything right?
Best regards