Hi,
I'm looking for some help with the rulesets in the Advanced Email Management system and how to create opportunities from emails.
I've successfully had emails be filed against Person/Company records but when I select the Action as 'Create Opportunity' it won't create the opportunity.
I'm using the communication.js template in which I've placed, under 'Utility Functions';
function createOppo(EntitiyName)
{
var myRecord = CRM.CreateRecord("opportunity");
myRecord.Oppo_PrimaryCompanyId= PersonQuery("pers_companyid");
myRecord.Oppo_PrimaryPersonId= PersonQuery("pers_personid");
myRecord.Oppo_AssignedUserId= AssignedUser;
myRecord.Oppo_ChannelId= AssignedChannel;
myRecord.Oppo_Description= eMail.Subject.substring(0, 39);
myRecord.Oppo_Source= "Email";
myRecord.Oppo_Note= "Please see the attached email";
myRecord.Oppo_Status= "In Progress";
myRecord.Oppo_Stage= "Lead";
myRecord.Oppo_Opened = mydate.getVarDate();
myRecord.SetWorkflowInfo("Opportunity Workflow", "Lead")
myRecord.SaveChanges();
intOppoRecordID = myRecord.oppo_opportunityid;
}
However, it still won't create any opportunities. Am I missing something?
Thanks