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));
Hi Zack, it is straight forward to do. When using the Query function you can pass the normal and custom fields (with the underscore prefix) that you want to return.
Thanks @Pav. Below is the code that I am using and the output from the code. I am able to obtain the opportunity and the custom field, however, I am not seeing the values of the custom field. In the _45Day custom field, there is a date. There is not a default value that is ever populated in to that field; that field is manually populated. In this example, this opportunity does have a date (I verified that in the UI). Below is the code and output:
Code:
<?php
error_reporting(E_ALL);
// Load Infusionsoft
require 'Infusionsoft/infusionsoft.php';
// Load config file (copy config.sample.php to config.php and put your clientid (key) and secret in.
require 'Infusionsoft/config.php';
$MyISOpportunityID = 3321;
$Opportunity_Custom_Field = array('Name', '_45Day');
$LeadInfo = Infusionsoft_DataService::query( new Infusionsoft_Lead(), array( 'Id' => $MyISOpportunityID), $Opportunity_Custom_Field);
var_dump($LeadInfo);
?>
Hi @Pav, yes I am - and that is embarrassing to realize; I apologize. I also believe that I have found a way to get all of the data I am looking for via the execution of saved searches.