You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm getting the error Call to a member function getEntityType() on null when I try to do any query.
It seems the problem starts in `EntityCollection.ph , line 77:
$response looks good as well (array of value is there; 1 element in it, with Name, Display_Name, Id, ...
But $this->query->getEntitySet returns null
Complete usage of SDK:
$sdk = \BusinessCentral\SDK::instance($myTenant, [
// OAuth2 [Required]'client_id' => $myClientId,
// Basic auth token [Required]'client_secret' => $mySecret,
// Default collection size [Optional]// Amount of entities to load initially and per page per collection// Can be changed on the fly on any collection instance'default_collection_size' => 20,
// Default environment [Optional - 'production' by default]'environment' => 'sandbox',
]);
$company = $sdk->company('company');
At creating the instance some warnings will come - maybe this is the reason?
Warning: Undefined array key "@attributes" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Trying to access array offset on value of type null in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Undefined array key "@attributes" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Trying to access array offset on value of type null in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Undefined array key "Namespace" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Undefined array key "@attributes" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Trying to access array offset on value of type null in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Undefined array key "Namespace" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Undefined array key "@attributes" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Trying to access array offset on value of type null in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 40
Warning: Undefined array key "NAV.ComplexTypes" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 55
Warning: Trying to access array offset on value of type null in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 55
Warning: foreach() argument must be of type array|object, null given in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 55
Warning: Undefined array key "NAV" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 59
Warning: Trying to access array offset on value of type null in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 59
Warning: foreach() argument must be of type array|object, null given in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 59
Warning: Undefined array key "NAV" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 63
Warning: Trying to access array offset on value of type null in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 63
Warning: Trying to access array offset on value of type null in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 63
Warning: foreach() argument must be of type array|object, null given in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 63
Warning: Undefined array key "NAV" in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 67
Warning: Trying to access array offset on value of type null in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 67
Warning: foreach() argument must be of type array|object, null given in \vendor\coolrunner\business-central-sdk\src\Schema.php on line 67
PHP Version: 8.1.6
The text was updated successfully, but these errors were encountered:
@thomasa00 Have you been able to solve this? we used this package recently for another project where it seems to work however for a new project it also gives me errors on the "@attributes" key in Schema.php
Edit: we are on PHP 8.0 in both projects, so isn't necessarily the PHP version.
@ArneAmeye did you manage to get it working?I have the same issue.
Nope, I ended up using the Http client by Laravel and a custom class to write my get and post calls depending on API routes provided by the external partner. The SDK is left unused for now...
Hi,
I'm getting the error
Call to a member function getEntityType() on null
when I try to do any query.It seems the problem starts in `EntityCollection.ph , line 77:
$response['@odata.context']
has a valid content:https://api.businesscentral.dynamics.com/v2.0/myTenant/sandbox/ODataV4/$metadata#Company
$response
looks good as well (array of value is there; 1 element in it, with Name, Display_Name, Id, ...But
$this->query->getEntitySet
returnsnull
Complete usage of SDK:
At creating the instance some warnings will come - maybe this is the reason?
PHP Version: 8.1.6
The text was updated successfully, but these errors were encountered: