当我使用该按钮时,无论相关的商机如何,都会使用相同的Docusign模板。如果我将(OPPNAME ='WorldQuant LLC%')行移到最后,则使用不同的模板,但无论机会名称如何,它都是相同的。我是Javascript的新手,所以请随意贬低任何答案,谢谢。
var OPPNAME;
var PICKDSTEMPLATE;
OPPNAME == '{!JSENCODE(Opportunity.Name)}';
PICKDSTEMPLATE = '{!Opportunity.Type_of_Opportunity__c}';
if (OPPNAME = 'WorldQuant LLC%')
{
DST = '75E95019-6513-4EE9-8f6B-C2FD9A99B9C2';
}
else if (OPPNAME != 'WorldQuant LLC%' && PICKDSTEMPLATE == 'Corp/Ind')
{
DST='38FE916A-0F28-46FD-BBAB-28CA54621B7E';
}
else if (OPPNAME != 'WorldQuant LLC%' && PICKDSTEMPLATE == 'Corporate from Lead')
{
DST = 'ACB0C25C-38FE-4802-9BEA-8CA5D8AA77A9';
}
else if (OPPNAME != 'WorldQuant LLC%' && PICKDSTEMPLATE == 'Corporate')
{
DST = 'ACB0C25C-38FE-4802-9BEA-8CA5D8AA77A9';
}
答案 0 :(得分:0)
得到一些帮助:
var ACCNAME;
var PICKDSTEMPLATE;
ACCNAME = '{!Opportunity.Account}';
PICKDSTEMPLATE = '{!Opportunity.Type_of_Opportunity__c}';
if ((ACCNAME == 'WorldQuant LLC') && (PICKDSTEMPLATE == 'Corp/Ind' || PICKDSTEMPLATE == 'Corporate'))
{
DST = '75e95019-6513-4ee9-8f6b-c2fd9a99b9c2';
}
else if ((ACCNAME != 'WorldQuant LLC') && (PICKDSTEMPLATE == 'Corp/Ind'))
{
DST='38FE916A-0F28-46FD-BBAB-28CA54621B7E';
}
else if ((ACCNAME != 'WorldQuant LLC') && (PICKDSTEMPLATE == 'Corporate from Lead'))
{
DST = 'ACB0C25C-38FE-4802-9BEA-8CA5D8AA77A9';
}
else if ((ACCNAME != 'WorldQuant LLC') && (PICKDSTEMPLATE == 'Corporate'))
{
DST = 'ACB0C25C-38FE-4802-9BEA-8CA5D8AA77A9';
}