Sage CRM - There is method to retrieve the ID on the recently created record when using CRM.CreateRecord object?

不想你离开。 提交于 2019-12-12 06:23:09

问题


Given this code:

var NewComm = CRM.CreateRecord("Communication");
NewComm("Comm_ChannelId") = Request.Form("chanId");
NewComm("Comm_Type") = "Appointment";
NewComm("Comm_DateTime") = Request.Form("initialHour");
NewComm("Comm_Status") = "Pending";
NewComm("Comm_Priority") = "Normal";
NewComm("Comm_Action") = "Meeting";
NewComm("Comm_SecTerr") = Request.Form("secTerr");
NewComm("Comm_Subject") = "No Subject";
NewComm("Comm_Note") = "No notes";
NewComm.SaveChanges();

There is a method of the CreateRecord Object to retrieve the ID of the recently created record?


回答1:


Once you have created the new record, the Id becomes available in the object. Using your example above, you can simply get the Id with this code:

NewComm.SaveChanges();
var CommId = NewComm("Comm_CommunicationId");

This applies to any record type with the same method.

Six Ticks Support



来源:https://stackoverflow.com/questions/39490658/sage-crm-there-is-method-to-retrieve-the-id-on-the-recently-created-record-whe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!