Creator to CRM integration
I have a script creating a record in the Contacts module in CRM from my Creator app form on submit. Works fine. I've just tried to add a similar conditional script to create a record in the Accounts module on edit and it does not work? The sendmail script on edit works fine. New script:
on edit
{
update
(
type = submit
displayname = "Update"
on success
{
if (input.Send_Confirmation.toString() == "Yes")
{
sendmail
(
To : input.Contact_Email, ("admin@xxx.com"), "bookings@xxx.com"
From : zoho.adminuserid
Subject : "Booking Confirmation"
Message : "Thank you for booking.</strong> We will be in touch prior to your presentation date.<br/><br/>" + input.Confirmation_Message + "<br/><br/>Please contact Cathy at admin@xxx.com if you have any questions regarding this booking.<br/><br/>Regards,<br/>Cathy"
)
}
if ((input.Send_to_Accounts).toString() == "Yes")
{
accountinfo = zoho.crm.create(("Accounts"), { "First Name" : "First_Name", "Last Name" : "Last_Name", ("Accounts Name") : "School_Organization", "Status" : "Status" }, 2);
}
}
)
cancel
(
type = cancel
displayname = "Cancel"
)
}
}
}