quotesDetailNewCheck: "quotesDetailNewCheck" = 'quotesDetailNewCheck'

Method name for PRE quotesDetailNewCheckPre and POST quotesDetailNewCheck

This method is triggered after pressing the New Quote button at /#/qc/quotes, but before the quote is created. If this method return false a quote will not be created and user will stay at quotes list. In this method you don't have access to quoteAPI, but you can use other api for checking conditions from CRMs.

Example: (Basic)

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

Example: (Basic disabling new quote create from interceptor)

export const quotesDetailNewCheck = async ({ api: { notify } }) => {
await notify.error('quotesDetailNewCheck returned false, you can not create a quote', { duration: 10 });

// When this method returns false the user is prevented from creating a new offer
return false;
};

Example: (Salesforce: Disable quoting from account page)

export const quotesDetailNewCheck = async ({ api: { crmManager, notify } }) => {
const payload = await crmManager.getPayload();
if (await crmManager.isAccountPage()) {
await notify.error('Quoting from an account page it is not possible');
return false;
}
};

Generated using TypeDoc