Dear ,
Greetings, for first point can you send snpit of code to clarification , second point i tried send throw Args object like an Array[ ] and send it by parameter but the problem was how i can make loop on grid to choose only selected rows “Invoice” ,by the way i save the check box as “NoYesId” Enum in “LeadgerJouranlTrans” Table as a flag “Invoice pool” from my issue after select press a bottun to pass values to another form and open it which i write code in Create() method to create a new sequence the code in below
for invoice pool form
Void Click()
{
Args args;
FormRun formRun;
// Our custom made class for passing complex set of parameters
FormBParams formBParams = new FormBParams();
Array items = new Array( Types::String );
int i;
;
args = new args();
for( i=0; i<LedgerJournalTrans_DS.numberOfRowsLoaded(); i++ )
{
items.value( i+1, int2str( DS_SelectToConsign.value(i)));
Info(int2str(LedgerJournalTrans_DS.numberOfRowsLoaded()));
}
formBParams.parmItems( items );
// Pass our object to FormB
args.parmObject( DS_AddToConsignment );
// Run FormB
args.name( formstr( DS_AddToConsignment ) );
formRun = classFactory.formRunClass( Args );
formRun.init();
formrun.run();
formrun.wait();
if( formrun.closedOk() )
{
DS_AddToConsignment.text( args.parm() );
}
super()
}
in the another form in create method
public void create(boolean _append = false,boolean extern=false)
{
DS_TmpInvoice DS_TmpInvoice;
;
element.numberSeqFormHandler().formMethodDataSourceCreatePre();
super(_append);
if (!extern)
{
// Info(DS_TmpInvoice.DS_Invoice);
element.numberSeqFormHandler().formMethodDataSourceCreate();
}
}
in init method
public void init()
{
FormBParams formBParams;
Array items;
int i;
;
super();
// Check for passed arguments
if( element.args() )
{
if( element.args().parmObject() )
{
formBParams = element.args().parmObject();
items = formBParams.parmItems();
for( i=1; i<=items.lastIndex(); i++ )
{
DS_Invoice.text(items.value(i));
}
// someDate.dateValue( formBParams.parmSomeDate() );
// someTime.value( formBParams.parmSomeTime() );
}
}
super();
}
note : FormBParams is class that has two accessors just to carry data in Array and get it
if you have another solution better without Args() please send to me because i received errors in this ,many thanks