MYOBCommunity
Partner Zone
|
|
Partner Zone

Custom fields array empty on Vardump

This thread is now closed to new comments.
Some of the links provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
Highlighted
Contributing Partner Olidev
6 Posts
Contributing Partner
Australia
Olidev
Contributing Partner

6Posts

0Kudos

0Solutions

Custom fields array empty on Vardump

Hi all-

When attempting to vardump the customfields array In MYOB AccountRight Sandbox 205 it returns null; with no fields inside of it. Here is the data that should be inplace.

Capture.PNG

 

What the var_dump returns: 

Capture.PNG

 

Here is my script; what are your thoughts?

 

 
$response = getURL(api_url.'/'.$_GET['guid'].'/Contact/Customer', '', '', api_key);
$API_endtime = microtime();
$API_endarray = explode(" ", $API_endtime);
$API_endtime = $API_endarray[1] + $API_endarray[0];
$response = json_decode($response);
 
foreach ($response as $r) {
if (!empty($r)) {
foreach ($r as $item) {
if ($item->IsIndividual) {
$card_id = $item->Id;
$fname = $item->FirstName;
$lname = $item->CoLastName;
echo "
Card ID: {$card_id} <br>
First Name: {$fname} <br>
Last Name: {$lname} <br>
";
if (sizeof($item->Addresses) > 0) {
if ($item->Addresses[0]->Street != NULL) {
$address = $item->Addresses[0]->Street;
echo "Address: {$address} <br>";
}
if ($item->Addresses[0]->Phone1 != NULL) {
$phone = $item->Addresses[0]->Phone1;
echo "Phone: {$phone} <br>";
}
if ($item->Addresses[0]->Email != NULL) {
$email = $item->Addresses[0]->Email;
echo "Email Address: {$email} <br>";
}
var_dump($item->CustomFields);
echo "<hr>";
}
}
}
}

 

 

Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post