Introduction
This entry will explain more details on the sample screen ForeignKeysCreateDialogSampleDialog
. The purpose is to show how to create a menu function, which directly fill some data in the detail screen from the overview screen.
When you open up the sample screen ForeignKeysCreateDialogSampleDialog
, you can choose an entry from the upper grid. When then opening the CreateDialog by using the FAB in the right down corner, you’ll see that this dialog will be opened with a value from the grid
How-to: Create menu function and add logic
- Create a menu entry and an action like known.
- In the action use:
- Action type: Launch
- Action Parameter: The name of your screen, which should be launched
- Action options:
{'autoAdd': true, 'foreignKeyProvider': '$ #.listEntryForeignFieldsProvider(eventSource)'}
- You see
listEntryForeignFieldsProvider(eventSource)
is a call to a typescript function
- In this function, you’ll define the mapping, see the example function below
- Here you’ll see that the field
SelfDesc
will be filled with a combination of test and theselfDesc
value from the choosen record
export function listEntryForeignFieldsProvider(entriesGrid: akioma.swat.Grid) {
const window = entriesGrid.screen;
const headDataSource = <akioma.swat.DataSource>window.getObject('dListHd');
return [{ name: 'SelfDesc', value: `New '${headDataSource.getCurrentRecord()?.selfdesc}' entry` }];
}
Back to Documentation
Back to Home Page