I am trying to open a new form from a button click.
I want to open the smmContactPerson form ALREADY in EDIT MODE to Add A New Contact record for THE CUSTOMER ACCOUNT associated with a specific SALES ORDER.
I know how to use the MenuFunction call to open the form BUT I want to send context info OR context arguments to the form SO THAT THE FORM WILL OPEN IN EDIT MODE AND SO THAT THE FORM WILL ALREADY BE TIED TO THE SPECIFIC CUSTOMER ACCOUNT FOR WHICH THE NEW CONTACT WILL BE ADDED.
I am not sure which context arguments I need to send to the form as parameters in the MenuFunction CREATE or RUN method. I am also curious WHETHER OR NOT THE MenuItem Display or Action String should be used inside the new MenuFunction constructor call.
The call and arguments that I used are listed below:
customerName = DirPartyTable::findRec(SalesTable.custTable_CustAccount().Party).Name;
objCustomer = CustTable::find(SalesTable.CustAccount);
objContactPerson = ContactPerson::ossCreateContactPerson("", objCustomer);
//setup and configure args/argument properties to pass into smmContactPerson
args.record(objContactPerson);
args.name(customerName);
args.caller(this);
formRun = new MenuFunction(menuitemDisplayStr(ContactPerson), MenuItemType::Display).create(args);
if (formRun) { formRun.run(); formRun.wait(); }
Any help would be greatly appreciated!!! Thanks...