Hello! I am using the XML-RPC API. I have 2 custom fields associated with opportunities that I would like to pull the values of. Everything I have tried, so far, has results in me being able to show the Infusionsoft_DataFormField object of the custom field. However, I have not been successful in retrieving the values contained within those custom fields.
Below is some sample PHP code that I am using:
$MyISOpportunityID = 3321; // MY OPPORTUNITY ID
$Opportunity_Custom_Field = ‘_CustomField1’; // THIS IS ONE OF THE TWO CUSTOM FIELDS CONNECTED TO AN OPPORTUNITY
$LeadInfo = Infusionsoft_DataService::query( new Infusionsoft_Lead(), array( ‘Id’ => $MyISOpportunityID));
$Test_This = array_shift($LeadInfo);
$customField = Infusionsoft_CustomFieldService::getCustomField($Test_This, $Opportunity_Custom_Field);
var_dump($customField);
From the above code, I get this output:
object(Infusionsoft_DataFormField)#41 (4) {
[“fields”:protected]=>
NULL
[“table”:protected]=>
string(13) “DataFormField”
[“data”:protected]=>
array(9) {
[“DataType”]=>
int(13)
[“Id”]=>
int(9)
[“FormId”]=>
int(-4)
[“GroupId”]=>
int(5)
[“Name”]=>
string(5) “CustomField1”
[“Label”]=>
string(6) “Custom Field 1”
[“DefaultValue”]=>
NULL
[“Values”]=>
NULL
[“ListRows”]=>
int(0)
}
[“appPoolAppKey”:protected]=>
string(22) “xxxx.infusionsoft.com”
}
I’m needing to pull the custom field values from opportunities that I specify.
Any help is greatly appreciated! Thanks in advance!