Hi all,
I want to hijiri calendar date so that i wrote a code below its not working.
[ExtensionOf(formStr(SysUserSetup))]
final class SysUserSetup_Extension
{
public void run()
{
FormComboBoxControl comoBoxCtrl = this.control(this.controlId(formControlStr(SysUserSetup, UserInfo_PreferredCalendar))) as FormComboBoxControl;
UserInfo userinfo = this.dataSource().cursor();
if (isLanguageArabic(userInfo.Language))
{
comoBoxCtrl.visible(true);
}
else
{
comoBoxCtrl.visible(false);
}
next run();
}
}
Control level code:
class SysUserSetup_Form_EventHandler
{
///
///
///
///
///
[FormControlEventHandler(formControlStr(SysUserSetup, UserInfo_PreferredCalendar), FormControlEventType::Leaving)]
public static void UserInfo_PreferredCalendar_OnLeaving(FormControl sender, FormControlEventArgs e)
{
FormComboBoxControl comboxCtrl = sender as FormComboBoxControl;
UserInfo userInfo = sender.dataSourceObject().cursor();
if(isLanguageArabic(comboxCtrl.text()))
{
comboxCtrl.visible(true);
userInfo.preferredCalendar = PreferredCalendar::Hijri;
}
else
{
comboxCtrl.visible(true);
userInfo.preferredCalendar = PreferredCalendar::Gregorian;
}
}
}
What am i doing wrong above the code? its possible in D365Fo ?
Please give me a example for that ?
Thanks