Const
export const quotesDetailSubmit = async ({ api, quoteAPI }) => {
// TODO: Add your code
return;
}
export const quotesDetailSubmit = async ({ quoteAPI, api: { notify }}) => {
const link = await quoteAPI.getHeaderInputValue('MedalliaSurveyLink');
if (link) {
await notify.success('<a href="' + link + '" target="_blank">Medallia Survey</a>', { duration: 30});
}
};
export const quotesDetailSubmit = async ({ api: { crmManager, notify } }) => {
const opportunityUrl = await crmManager.getOpportunityURL("");
// Edit payload with your data
const payload = {
Name: "Created Opportunity from Interceptor 10",
StageName: "Prospecting",
CloseDate: "2023-06-30",
Amount: 10000,
Accountid: "0011X000018dsrMQAQ",
Description: "This is a new opportunity created from Interceptor.",
};
return crmManager
.postCall(opportunityUrl, "POST", payload)
.then((response) => {
console.log(response);
if ([200, 201].includes(response.status)) {
notify.success("Opportunity created successfully.");
} else {
notify.error(
`Failed to create opportunity. ${response.payload[0].message}`
);
}
});
};
Method name for PRE
quotesDetailSubmitPre
and POSTquotesDetailSubmit
Triggered after user press an OK button in submit modal at quote detail page
/#/qc/quotes/<quoteId>
.Notes: To open the submission modal, users need to click on the Submit button on the quote detail page.