Hi All,
I have created the Flyout button but when i clicked on the button no action is happening,
step 1: Created Flyout button (A)
step 2:Added Menu section in Flyout button
step 3:Placed a new button say (B) in menu section and created a command where i added my js file and function to it.
Step 4:Selected command which i created in Button B then published
function SalesCordinatorAssign(){
debugger;
var id =Xrm.Page.data.entity.getId();
var entityName = Xrm.Page.data.entity.getEntityName();
if (Xrm.Page.getAttribute("owner").getValue() != null) {
var lookupValue = new Array();
lookupValue[0] = new Object();
lookupValue[0].id = "032A183F-3FB3-E811-A951-000D3AB421B7";
lookupValue[0].name ="Anitha Venkatachalapathy";
lookupValue[0].entityType = "system user"
Xrm.Page.getAttribute(“FieldName”).setValue(lookupValue);
alert("Assigned to Sales Coordinator");
}
I guess the issue is with js code.On click of button B the owner field should be changed as above.
*This post is locked for comments
Thanks you for pointing me this.Now its working fine
Hi Divya,
Try using the JS code below.
function SalesCordinatorAssign() { debugger; var id = Xrm.Page.data.entity.getId(); var entityName = Xrm.Page.data.entity.getEntityName(); if (Xrm.Page.getAttribute("ownerid").getValue() != null) { var lookupValue = new Array(); lookupValue[0] = new Object(); lookupValue[0].id = "032A183F-3FB3-E811-A951-000D3AB421B7"; lookupValue[0].name = "Anitha Venkatachalapathy"; lookupValue[0].entityType = "systemuser"; Xrm.Page.getAttribute("FieldLogicalName").setValue(lookupValue); alert("Assigned to Sales Coordinator"); } }
Hope this helps.
Hi Divya,
Check if schema name for Owner is correct.
I guess it should be "ownerid"
In this line "Xrm.Page.getAttribute("owner").getValue() != null"
Regards,
Nodal
Hi Divya,
Entity types ( systemuser) should be without space.
lookupValue[0].entityType = "systemuser"
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,842
Most Valuable Professional
nmaenpaa
101,156