quotesDetailOpportunityCreate: "quotesDetailOpportunityCreate" = 'quotesDetailOpportunityCreate'

Method name for PRE quotesDetailOpportunityCreatePre and POST quotesDetailOpportunityCreate

Triggered when a user presses button Create Opportunity at quote detail page /#/qc/quotes/<quoteId>.

Example: (Basic)

export const quotesDetailOpportunityCreate = async ({ api, quoteAPI }) => {
// TODO: Add your code
return;
}

Example: (Salesforce: Create multiple sobjects with one request)

export const quotesDetailOpportunityCreate = async ({ api, quoteAPI }) => {
const { crmManager, notify } = api;

const url = await crmManager.getOpportunityURL("");
const opportunityLineItemUrl = url.replace(
"Opportunity/",
"OpportunityLineItem/"
);
const compositeUrl = url.replace("sobjects/Opportunity/", "composite/");
const deleteOpportunityLineItems = ["123"];

const compositeLineItems = {
allOrNone: true,
compositeRequest: [
{
method: "POST",
url: opportunityLineItemUrl,
referenceId: "uniqueValue1",
body: {
// sobject body
},
},
{
method: "POST",
url: opportunityLineItemUrl,
referenceId: "uniqueValue2",
body: {
// sobject body
},
},
{
method: "DELETE",
url: opportunityLineItemUrl + deleteOpportunityLineItems[0],
referenceId: "uniqueValue3",
body: {},
},
],
};

return crmManager
.postCall(compositeUrl, "POST", compositeLineItems)
.catch((error) => {
notify.error(error);
});
};

Generated using TypeDoc