Hi experts,
I have used the following code to add a custom phone call activity onSave of a case record.
/*This function will help to create PhoneCall Activity entity Record*/ function TaskCreation() { //get Current Logged in User name var UserName=Xrm.Page.context.getUserName(); //get Logged is user GUID var UserId=Xrm.Page.data.entity.getId(); //Get Current timer value var TimerValue = Xrm.Page.getAttribute("new_timer").getValue(); //Get Primary Contact var con = Xrm.Page.getAttribute("customerid").getValue(); //Set Task Activity Entity record var Task = {}; Task.Subject = "Call Timing of User "+UserName; //set task subject Task.Description = "Call Running Time is "+TimerValue+" and User Name: "+UserName; //set Task Description Task.RegardingObjectId = { Id: Xrm.Page.data.entity.getId(), LogicalName: 'incident'}; //set parent entity type //finally create Task SDK.REST.createRecord(Task,"PhoneCall", function (Task) { writeMessage("The phonecall with Subject \"" + Task.Subject + "\" was created"); },errorHandler); //Error handling function errorHandler(error) { writeMessage(error.message); } }
The problem is the the customer name is not populating and in the view it is showing it as "Customer Not found"
Is there something missing in my script?
Thanks
*This post is locked for comments