Hi,
I am not a programmer but with the help of few blogs, I am trying this. I am concatenating few fields of appointment entity to form topic (i.e.) "Account's owner/first 5 characters of Account Name/Appointment location/Appointment type (which is an option field)".
"Regarding" field is already restricted to be account only. I am able to get everything done apart from regardingobjectid's owner into this concatenation. This is what I have so far:
function concatappointmentsubject()
{
var SubName = Xrm.Page.getAttribute("new_subname").getValue();
var City = Xrm.Page.getAttribute("location").getValue();
var Type = Xrm.Page.data.entity.attributes.get("new_type");
var Typetext = Type.getText();
var Compnamelookup = Xrm.Page.getAttribute("regardingobjectid");
var CompnamelookupTextvalue;
if (Compnamelookup != null)
{
var CompnamelookupValue = Compnamelookup.getValue();
if ((CompnamelookupValue != null))
{
CompnamelookupTextvalue = CompnamelookupValue[0].name;
var Compnamelookupid = CompnamelookupValue[0].id;
var Compa = CompnamelookupTextvalue.substring(0, 5);
}
}
Xrm.Page.getAttribute("new_subname").setValue(Compa + "/" + City + "/" + Typetext);
Xrm.Page.getAttribute("new_subname").setSubmitMode("always");
}
Could someone help me to include appointment's account's owner in this concatenation?
Thanks for the help!
*This post is locked for comments