In this example I'm going to hide "Description' field from the ledgertrans form.
For that I have created a event handler class in the extension model(Newly created model for extensions and event handlers ).
class LedgerTransAccount_Eventhandler
{
[FormDataSourceEventHandler(formDataSourceStr(LedgerTransAccount, GeneralJournalAccountEntry), FormDataSourceEventType::Activated)]
public static void LedgerTrans_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
GeneralJournalAccountEntry generalJournalAccountEntry = sender.cursor(); //selected record
FormDataSource generalJournalAccountEntry_ds = sender.formRun().dataSource("GeneralJournalAccountEntry");
FormRun element = sender.formRun(); //form element
FormControl tabOverview = element.design(0).controlName("TabOverview"); //New button on the form
element.control(element.controlId(formControlStr(LedgerTransAccount, LedgerTrans_Txt ))).visible(false);
}
}
For that I have created a event handler class in the extension model(Newly created model for extensions and event handlers ).
class LedgerTransAccount_Eventhandler
{
[FormDataSourceEventHandler(formDataSourceStr(LedgerTransAccount, GeneralJournalAccountEntry), FormDataSourceEventType::Activated)]
public static void LedgerTrans_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
GeneralJournalAccountEntry generalJournalAccountEntry = sender.cursor(); //selected record
FormDataSource generalJournalAccountEntry_ds = sender.formRun().dataSource("GeneralJournalAccountEntry");
FormRun element = sender.formRun(); //form element
FormControl tabOverview = element.design(0).controlName("TabOverview"); //New button on the form
element.control(element.controlId(formControlStr(LedgerTransAccount, LedgerTrans_Txt ))).visible(false);
}
}
No comments:
Post a Comment