Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Limitation of editable grid option set add remove options not working

$
0
0

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;
            }

        });
    });

}



Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images