Closed onlinecheckwriter-zz closed 4 years ago
Hi @onlinecheckwriter,
To create a record:
use Zoho\CRM\Facades\ZohoCRM;
class MyController extends Controller
{
public function store(Request $request)
{
$record = ZohoCRM::createRecords('Leads', [
'Account_Name' => "Testing"
]);
var_dump($record);
}
}
If we follow your documentation: We are getting an error: vendor\interconnecta\zoho-crm\src\API.php392
But if we called as follow
class MyController extends Controller
{
public function store(Request $request)
{
$record = ZohoCRM::createRecords('Leads', [[
'Account_Name' => "Testing"
]]);
var_dump($record);
}
}
We are getting this error: array(1) { [0]=> array(4) { ["code"]=> string(19) "MANDATORY_NOT_FOUND" ["details"]=> array(1) { ["api_name"]=> string(9) "Last_Name" } ["message"]=> string(24) "required field not found" ["status"]=> string(5) "error" } }
You need to map the mandatory field "Last Name". It is a required field in your Lead's module.
$record = ZohoCRM::createRecords('Leads', [ [
"Account_Name" => "Testing",
"Last_Name" => "Joe Doe"
]]);
@emw3 This is actually a bug. Client::createRecord
tries to call the non-existent method API::createRecord
. I would suggest keeping it as a shortcut for $this->createRecords($module, [$record], $params);
.
Is it something like this? $new = new \Zoho\CRM\Client(); $data = zohocrm::createRecord("Leads",["Account_Name"=>"Testing1000"]); it is saying not found