Monday, January 23, 2023

Simple dialog with with field in D365FO

[Control("Button")]
    class BtnMarkAsReserved
    {
        /// <summary>
        ///
        /// </summary>
        public void clicked()
        {
            //Declare dialog variables
            Dialog                  dialog;
            DialogField             fieldfMemo;
            Notes                   notes;
            ;

            dialog = new Dialog("Comment");

            //define fields to show on the dialog
            fieldfMemo = dialog.addField(extendedTypeStr(Notes));
            dialog.run();
           
            if (dialog.closedOk())
            {
                //get values from the dialog fields
                notes = fieldfMemo.value();

                ActivityLogDetails_DIS logDetails;
                MultiSelectionHelper helper = MultiSelectionHelper::construct();

                helper.parmDatasource(ActivityLogDetails_DS);

                logDetails= helper.getFirst();
                while (logDetails.RecId != 0)
                {
                    info(logDetails.ItemID);

                    logDetails= helper.getNext();
                }
            }

            super();
        }

    }

No comments:

Post a Comment

Table browser URL in D365FO

Critical Thinking icon icon by Icons8