Hi folks
I would like to call SalesCreateOrder by my own function (from a custom form) like:
SalesTableForm salesTableForm = SalesTableForm::construct(SalesTableFormId::None, null);
CustTable custTableLocal = element.custTable_ds.cursor();
salesTableForm.custAccount(custTableLocal.AccountNum);
boolean created = salesTableForm.create();
if (created)
{
Args args = new Args();
args.record(salesTableForm.salesTable());
args.caller(this);
new MenuFunction(menuItemDisplayStr(SalesTableForEdit), MenuItemType::Display).run(args);
}
After several hours of testing and debugging I got an error in the standard class SalesCreateOrder in the following function
void create(boolean append = false)
{
if (!salesTable.SalesId)
{
super(append);
salesTableType.formMethodDataSourceCreate(element, salesTable_ds);
}
}
The highlighted code does nothing, when another role than SystemAdministrator is executing this function, salesTableType is then still "null" and I get the error.
I have no idea, why super is doing nothing, the used role has all necessary rights.
Markus