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

SFDCConnection

Yes

Salesforce connection - it is the object resulted from the call to the connectToSalesforce routine.

sfdcOpportunityIdstringYesID of the Salesforce opportunity to be updated.
sfdcOpportunitySFDCOpportunityYesStructure containing the fields of the opportunity to be updated.
sfdcAPIVersionstringNoSalesforce API version to be called when creating the opportunity, it should have the following format: "vXX.X" - eg: "v43.0", "v42.0".
It is not required and if empty, the latest available version will be used.

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);

See also