Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

Syntax

sfdcCreateOpportunity(sfdcConnection, sfdcOpportunity, [sfdcAPIVersion])

Description

Excerpt

Creates an opportunity in the Salesforce environment.


Parameters

Parameter

Type

Required

Description

sfdcConnection

SFDCConnection

Yes

The

Salesforce

Connection

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

sfdcOpportunitySFDCOpportunityYesStructure containing the fields of the opportunity that will be created. This is a predefined structure type described below. When creating an opportunity, there are three
mandatory
required fields that must have values: Name, CloseDate, and StageName.
sfdcAPIVersionstringNoThe Salesforce API
Version
version to be called when creating the opportunity
;
, it should have the following form: "vXX.X" - eg: "v43.0", "v42.0".
It is not
mandatory, if missing
required and if empty, the latest available version will be used.


SFDCOpportunity

...

SFDCOpportunity 

...

CloseDate

...

date

...

Name

...

string

...

fields and types

Note
titleNote

CloseDateName, and StageName attributes are required when creating a new SFDCOpportunity type. See SFDCOpportunity for more details.


Return type

string - the Salesforce Opportunity ID

Example

The following example will create an opportunity in Salesforce with the specified fields.

Code Block
SFDCConnection conn = connectToSalesforce("SFDC_test");
logPrint("WARN", "Connected to SF: " + conn.instance_url + " - " + conn.access_token);

SFDCOpportunity opp;
opp.Name = "Test Opp using routine";
opp.CloseDate = currentDate();
opp.StageName = "Prospecting";

string oppId = sfdcCreateOpportunity(conn, opp, "v43.0");

logPrint("WARN", "Created opportunity with id: " + oppId);

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "sfdc_routines"
labelsbasic_routines