Hi,
I added new button “Back to draft” in the Approval menu in the Journal. Basically what it has to do it when the user click that button, the journal which is already reported as ready should be reverted back so that user can amend the journal.
The problem I am having now is I am not being able to figure out the way to retrieve the selected row in the journal.
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> [FormControlEventHandler(formControlStr(LedgerJournalTable, BackToDraft2), FormControlEventType::Clicked)] public static void BackToDraft2_OnClicked(FormControl sender, FormControlEventArgs e) { FormRun formrun = sender. Object LedgerJournalTable_DS = FormRun.dataSource(formDataSourceStr(LedgerJournalTable,LedgerJournalTable)); LedgerJournalTable localLedgerJournalTable = LedgerJournalTable_DS.getFirst() as LedgerJournalTable; localLedgerJournalTable.ReportedAsReadyBy = ''; LedgerJournalTable_DS.research(); }
Here is the code which just retrieves the first row in the data source but I need to retrieve the selected row in the grid so that I can change the status for that particular record. How would I do that using event handling?
Thank you,
*This post is locked for comments
I know that the question is almost a year ago, but I want to share my solution for the programmer who is looking for.
LedgerJournalTable ledgerJournalTable; FormDataSource LedgerJournalTable_DS = sender.formRun().dataSource("LedgerJournalTable"); ledgerJournalTable = LedgerJournalTable_DS.cursor();
Why don't you simply use a menu item button and receive the record in args.record() as usual?
If you insist on your design, try something like sender.dataSourceObject().cursor().
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156