sfdcUpdateOpportunity
Syntax
sfdcUpdateOpportunity(sfdcConnection, sfdcOpportunityId, sfdcOpportunity, [sfdcAPIVersion])
Description
Updates an opportunity from the Salesforce environment.
The update will be performed only for the fields specified in the sfdcOpportunity object sent as a parameter, the rest of the fields will remain unchanged.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
sfdcConnection | Yes | Salesforce connection - it is the object resulted from the call to the connectToSalesforce routine. | |
sfdcOpportunityId | string | Yes | ID of the Salesforce opportunity to be updated. |
sfdcOpportunity | Yes | Structure containing the fields of the opportunity to be updated. | |
sfdcAPIVersion | string | No | Salesforce API version to be called when creating the opportunity, it should have the following format: "vXX.X" - eg: "v43.0", "v42.0". |
Return type
string - You can safely ignore the return value of this routine.
Example
The following example will update Opportunity fields in Salesforce.
SFDCConnection conn = connectToSalesforce("SFDC_test");
logPrint("WARN", "Connected to SF: " + conn.instance_url + " - " + conn.access_token);
SFDCOpportunity opp;
opp.Name = "Updated using routine v2";
opp.CloseDate = currentDate();
sfdcUpdateOpportunity(conn, "opportunity ID", opp);