Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Issue with Flyout Buttons

(0) ShareShare
ReportReport
Posted on by 245

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

  • Suggested answer
    DivyaBharathi Profile Picture
    DivyaBharathi 245 on at
    RE: Issue with Flyout Buttons

    Thanks you for pointing me this.Now its working fine

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,076 on at
    RE: Issue with Flyout Buttons

    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.

  • Verified answer
    NODAL Profile Picture
    NODAL 860 on at
    RE: Issue with Flyout Buttons

    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

  • Suggested answer
    gdas Profile Picture
    gdas 50,087 on at
    RE: Issue with Flyout Buttons

    Hi Divya,

    Entity types (  systemuser) should  be without space.

    lookupValue[0].entityType = "systemuser"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans