I have a requirement to change the default value of a checkbox in SysUserSetup form to true. The data source of this field is SysUserInfo > EventWorkflowTasksInEmail. I have tried to do this by writing the following code in post event handler of initValue method of the table:
[PostHandlerFor(tableStr(SysUserInfo), tableMethodStr(SysUserInfo, initValue))]
public static void SysUserInfo_Post_initValue(XppPrePostArgs args)
{
SysUserInfo sysUserInfo = args.getThis() as SysUserInfo;
sysUserInfo.EventWorkflowTasksInEmail = NoYes::Yes;
}
But the value of checkbox is still false. Can anyone suggest if I am missing something ?
Edit : I debugged my code and found that the customization is not being executed , any reason why ?
The method gets executed when I import users from AAD and the change is working fine but it does not work when I create a new user from D365 itself , is there a way to achieve the latter ?