var user = ZDK.Apps.CRM.Users.fetchById($Crm.user.id); log(user.profile.name); if (user.profile.name != "Salesperson")&&(user.profile.name != "Administrator") { ZDK.Page.getField("Status").setReadOnly(true); } |
var user = ZDK.Apps.CRM.Users.fetchById($Crm.user.id); var record = $Page.record_id; // send email when the order status is "Dispatched" if (value == "Dispatched") { var mail = new ZDK.Apps.CRM.__Actions.Models.Mail(); mail.from = { "user_name": "ABC Industries", "email": "ABCIndustries@ABC.com" }; mail.to = [{ "user_name": user.first_name + " " + user.last_name, "email": user.email }]; mail.subject = "You order has been " + value; mail.content = "Hello" + " " + user.first_name + " " + user.last_name + ", " + "We are glad to let you know that your order has been dispatched"; mail.mail_format = "text"; var response = ZDK.Apps.CRM.Orders.sendMail(mail, recordrecord); ZDK.Client.showMessage("Sent mail to notify that the order dispatch is done.", { type: 'success' }); } // Add tag when the order status is "Delivered" if (value == "Delivered") { var Order = ZDK.Apps.CRM.Orders.fetchById(record); var response = Order.__addTags(["Delivered"]); } |
Writer is a powerful online word processor, designed for collaborative work.