Eg. From Purchase order form, open the document handling of the vendor (VendTable) instead of for the purchase order (PurchTable).
It can be achieved with the following 4 steps:
- Add the related table as datasource in the form
- Add a boolean global variable to 'ClassDeclaration'
- Overwrite the method 'docCursor'
- Add a button and overwrite the 'clicked' method
1. Add the related table as datasource in the form
2. Add a boolean global variable to 'ClassDeclaration'
class FormRun extends ObjectRun
{
boolean vendDoc;
}
3. Overwrite the method 'docCursor'
public Common docCursor()
{
Common docCursor;
;
docCursor = super();
if(vendDoc)
docCursor = vendTable;
return docCursor;
}
4. Add a button and overwrite the 'clicked' method
void clicked()
{
super();
vendDoc = true;
if (!infolog.docu().isDocuViewSet())
infolog.docu().note(element);
else
infolog.docu().setActive();
vendDoc = false;
}