Closed ebrahimradi closed 1 year ago
till now, I find out that I cannot use like this. we have to use it like:
$oClient ->patch( 'data/VendorsV3' . '(' . implode(',', [ "VendorAccountNumber='" . $vendor->VendorAccountNumber . "'", "dataAreaId='" . $vendor->dataAreaId . "'" ]) . ')' , ['VendorOrganizationName' => 'test'] );
info:
$oClient = ODataClient();
and
then
$oClient->setEntityReturnType(Vendor::class); $dataArray = $oClient->from("data/VendorsV3") ->where('OrganizationNumber', $organizationNumber) ->get();
it cause error:
method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
so i fixed it by editing vendor/saintsystems/odata-client/src/ODataRequest.php:378 to
if ((is_object($arrayValue) || is_string($arrayValue)) && method_exists($arrayValue, 'getProperties')) {
and then after call i got this error:
Client error:
PATCH https://XXX.dynamics.com/data/VendorsV3resulted in a
400 Bad Requestresponse: { "error":{ "code":"","message":"An error has occurred.","innererror":{ "message":"More than one resource (truncated...)