I want to pass parameter from Salestable Form to the initJournal method of SalesFormLetter_Confirm.
I could pass parameter from Salestable Form to the main of SalesFormletter using this:
in the clicked method of a menuitemButton that call the class : SalesFormLetter in the form I wrote this :
void clicked()
{
boolean ProformaOk;
Args args = new Args();
;
element.args().parm(‘OK’);
super();
}
and in the main of SalesFormLetter Class I wrote this and I got the rignt value.
SalesFormLetter_Confirm. extends from SalesFormLetter , it has no main method , there is no args in the initJournal method. I wonder how to do to pass the parameter either directely to the salesFormLetter_Confirm or by passing through the parent class : SalesFormLetter.
You can create a variable in the classDeclaration of SalesFormLetter and then store that parm value if you want. Then from SalesFormLetter_Confirm, you should be able to access it. I would try a different method than passing the variable though.
What you are doing is going against the design of the SalesFormLetter classes. I wouldn’t put anything in the main method, but instead in the mainOnServer method, because that is where the SalesFormLetter is actually instantiated.
You need to create a parm method and a variable in the classDec too obviously. And you should only need in your button clicked method, element.args().parm(‘OK’); and not some of the other stuff.
I’d need to know what you are actually trying to accomplish to try and think of a better method…but it seems like you could create a new menu item with a different enum param or something.
I understand , I thought of doing so but for my work consists on creating an invoice similar to confirmation invoice, the process is the same as SalesFormLetter_Confirm , I need just to add a field to distinguish between the two docuementStatus of the two invoices I thought it would be easier to add this field and check it in the main method.
I think you’re right I’ve changed the design of the SalesFormLetter classes.