Hello team!
We would like to add new lead disqualification statuses. How can we do it?
Like
Hello Jake!
1. We register a new lookup "Lead Status"
2. We add a new status. After adding click on "Edit" to find out its ID.
3. In configuration add a replacing client module for Lead Page. Add localizable strings.
4. Add the script:
define('LeadPage', ['ext-base', 'terrasoft', 'Lead', 'LeadPageStructure', 'LeadPageResources',
'BusinessRuleModule', 'GeneralDetails', 'ConfigurationConstants', 'MaskHelper'],
function(Ext, Terrasoft, Lead, structure, resources, BusinessRuleModule, GeneralDetails,
ConfigurationConstants, MaskHelper) {
structure.userCode = function() {
function DisqualifyLead(statusId) {
var account = this.get('Account');
var contact = this.get('Contact');
if (!account && !contact) {
this.showInformationDialog(resources.localizableStrings.requiredFieldsMessage1);
return;
}
var scope = this;
this.showConfirmationDialog(resources.localizableStrings.DisqualifyLeadActionMessage1,
function(returnCode) {
if (returnCode === Terrasoft.MessageBoxButtons.YES.returnCode) {
scope.set('Status', {value: statusId});
}
}, ['yes', 'no']);
}
var menu = this.actions[1].menu.items ? this.actions[1].menu.items : null;
var qualifiedNewStatusId = '7d3d6c16-d562-4a3e-94e4-4b7d438ece66';
if (menu)
{
menu.push(
{
caption: resources.localizableStrings.NewLeadStatusCaption,
click: {
bindTo: 'QualifyNewStatus'
}
}
)
}
this.methods.QualifyNewStatus = function() {
DisqualifyLead.call(this, qualifiedNewStatusId);
};
return structure;
});
5. Publish