October 03, 2023

X++ code to Enable/Disable the form controls based on User groups in D365FO

 UserGroupList userGroupList;

select firstonly RecId from userGroupList where userGroupList.groupId == VendParameters::find().UserGroupId && userGroupList.userId == curUserId(); this.form().design().showNewButton(userGroupList.RecId ? 1 :0);