web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Limitation of editable grid option set add remove options not working

(0) ShareShare
ReportReport
Posted on by 50,091 Moderator

Hello Friends ,

Seems this is  limitation of Dynamics 365 editable grid. I have registered a function  in one of the field onchange event in the editable grid  and making options add , remove from one optionset field in the editable grid but its not working . However I can see all the method is there in the control when I am getting from selected rows .

Here is my code in the onchange event of one text field in the editable grid. Does anyone have any idea or anyone implemented the same .

function OnChangeField() {
    debugger;
    
    //get the selected rows - use the getControl method and pass the grid name.
    selectedRow = Xrm.Page.getControl("Fee").getGrid().getSelectedRows();

    //loop through rows and get the attribute collection
    selectedRow.forEach(function (row, rowIndex) {

        //get the attribute Collection
        attributeColl = row.getData().getEntity().attributes;

        //loop through attribute Collection and do the calculation and set the 
        attributeColl.forEach(function (att, attIndex) {

            switch (att.getName()) {
                case "stu_feetype":
                    //get the value of price
                    if (att.getValue() != null && att.getValue() != 'undefined') {


                        var optionSet = att;
                        var optionSetValues = att.getOptions();
                        optionSet.clearOptions();
                        for (i = 0 ; i < optionSetValues.length ; i++) {
                            if (optionSetValues[i].value == "956560000")
                                optionSet.addOption(optionSetValues[i]);
                            else
                                optionSet.removeOption(optionSetValues[i]);

                        }

                    }
                    break;
            }

        });
    });

}


multieditlimitation.png

*This post is locked for comments

I have the same question (0)
  • Verified answer
    SergiiChvyr Profile Picture
    on at

    Hi,

    Yes, this issue is still there. Option manipulation methods should be in control, but in grid they appear in attribute. And yes, they do not work still. I see code is actually empty, so this might be an error

    2019_2D00_05_2D00_06-13_5F00_04_5F00_59_2D00_Opportunity_5F00_.png

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans