public function close(DynamicsCRM2011_Connector $crmConnector, $status, $subject = NULL)
 {
     if ($this->ID == self::EmptyGUID) {
         throw new Exception('Cannot Close an Incident that has not been Created!');
         return FALSE;
     }
     /* Create the Incident Resolution */
     $_resolution = new DynamicsCRM2011_IncidentResolution($crmConnector);
     /* Link the resolution to this Incident */
     $_resolution->IncidentId = $this;
     /* Set the Subject of the Resolution to the supplied Subject, or the Incident Title if none supplied */
     $_resolution->Subject = $subject == NULL ? $this->Title : $subject;
     /* Resolve the Incident */
     $crmConnector->closeIncident($_resolution, $status);
 }
 /**
  * Update the Domain Name that this Entity will use when constructing an absolute URL
  * @param DynamicsCRM2011_Connector $conn Connection to the Server currently used
  */
 protected function setEntityDomain(DynamicsCRM2011_Connector $conn)
 {
     /* Get the URL of the Organization */
     $organizationURL = $conn->getOrganizationURI();
     $urlDetails = parse_url($organizationURL);
     /* Generate the base URL for Entities */
     $domainURL = $urlDetails['scheme'] . '://' . $urlDetails['host'] . '/';
     /* If the Organization Unique Name is part of the Organization URL, add it to the Domain */
     if (strstr($organizationURL, '/' . $conn->getOrganization() . '/') !== FALSE) {
         $domainURL = $domainURL . $conn->getOrganization() . '/';
     }
     /* Update the Entity */
     $this->entityDomain = $domainURL;
 }
コード例 #3
0
are not know.

Then, call the setDiscoveryFederationSecurity method with the appropriate
login details.  The Object will then use these details to find the correct 
URI to use for the Organization service for the Organization you have 
specified in the constructor.

Each step takes around 5 seconds - so you could call the Constructor before
displaying the Login page, and then use the setDiscoveryFederationSecurity
after receiving Login details (assuming the Object is kept for the entire
session)
*****************************************************************************/
if (!defined('SKIP_DEMO1')) {
    /* Connect to the Dynamics CRM 2011 server */
    echo date('Y-m-d H:i:s') . "\tConnecting to the CRM... ";
    $crmConnector = new DynamicsCRM2011_Connector($discoveryServiceURI, $organizationUniqueName);
    echo 'Done' . PHP_EOL;
    /* Here, you could ask the user for the login details... */
    echo date('Y-m-d H:i:s') . "\tVerifying Security Details... ";
    $loginOkay = $crmConnector->setDiscoveryFederationSecurity($loginUsername, $loginPassword);
    if ($loginOkay) {
        echo 'Login Okay!' . PHP_EOL;
    } else {
        echo 'Login Failed!' . PHP_EOL;
    }
}
/****************************************************************************
To fetch data from Microsoft Dynamics CRM 2011, we use a simpe query language
known as "Fetch XML".  This is a Microsoft design, which uses XML to specify 
what data is required.  There are several references available for this on 
the internet, but the simplest option is to use the "Advanced Find" tool on 
 /**
  * Set the connector timeout value
  * @param int $_connectorTimeout maximum time the connector will wait for a response from the CRM in seconds
  */
 public static function setConnectorTimeout($_connectorTimeout)
 {
     if (!is_int($_connectorTimeout)) {
         return;
     }
     self::$connectorTimeout = $_connectorTimeout;
 }