Const
export const quotesDetailOpportunityCreate = async ({ api, quoteAPI }) => {
// TODO: Add your code
return;
}
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);
});
};
Method name for PRE
quotesDetailOpportunityCreatePre
and POSTquotesDetailOpportunityCreate
Triggered when a user presses button Create Opportunity at quote detail page
/#/qc/quotes/<quoteId>
.