Was this helpful?
Edit a Provisioning
We are now going to modify an existing provisioning. In this case select provisioning "12272" (we obtained the id from the item parameter from the response above). In this case we want to add some missing functionality to this particular provisioning by adding some parameters and rescheduling the runs.
First, fetch the provisioning itself. In order to do this use:
restCall('provisioning/12272?s=' + sessionId, 'GET', ' ', hdlfindProvisioningSuccess, hdlfindProvisioningFailure);
With the handler looking like:
var hdlfindProvisioningSuccess = function(data) {
   alert(data);
}
var hdlfindProvisioningFailure = function(data) {
   alert('There was an error obtaining the provisioning');
}
In this case the response looks like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<Provisioning id="12272">
   <expirationDate>2030-12-30T19:00:00-05:00</expirationDate>
   <parameters>
      <parameter key="Salesforce.com.password">PASSWORD</parameter>
      <parameter key="Salesforce.com.username">USERNAME</parameter>
   </parameters>
   <process>piccp.1.0.djar</process>
   <product>PRODUCTID</product>
   <schedule>0</schedule>
   <startDate>2009-10-12T00:00:00-04:00</startDate>
</Provisioning>
So we will modify the XML since this is what we will use to post back to the system to make our changes. In this case we will add a third parameter called "DEBUG Mode" and set the value to "TRUE". We are also going to change the schedule option to a "360" which run the provisioning every 360 min. This number represents the time between runs.
Modified Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<Provisioning id="12272">
   <expirationDate>2030-12-30T19:00:00-05:00</expirationDate>
   <parameters>
      <parameter key="Salesforce.com.password">PASSWORD</parameter>
      <parameter key="Salesforce.com.username">USERNAME</parameter>
      <parameter key="DEBUG Mode">TRUE</parameter>
   </parameters>
   <process>piccp.1.0.djar</process>
   <product>PRODUCTID</product>
   <schedule>360</schedule>
   <startDate>2009-10-12T00:00:00-04:00</startDate>
</Provisioning>
We will store our XML inside a variable called "XMLOBJ".
var XMLOBJ = <XML DATA WE EDITED ABOVE>;
We will now POST the data that we have modified:
restCall('provisioning?s=' + sessionId, 'POST', XMLOBJ, hdlmodifyProvisioningSuccess, hdlmodifyProvisioningFailure);
var hdlmodifyProvisioningSuccess = function(data) {
   alert('Success');
}
var hdlmodifyProvisioningFailure = function(data) {
   alert('Failed to modify provisioning');
}
Last modified date: 12/17/2021