Hi to all,
could someone resolve the following problem?
I PART.
The goal is that of obtaining a table that, for every item, can write, near to QuantityLoaded, the ProgressiveLoadedQuantityRelativeToThat line item.
For Ex. Line1: quantita_caricat 10; progressivo_relat_quant_caricata 10;
Line2: quantita_caricat 23; progressivo_relat_quant_caricata 33; and so on.
In order to the goal i created the table
progressivi_carico_art which contain :
progressivi_carico_artid
fkid_articolo
quantita_caricata
progressivo_relat_quant_caricata
The table above feeds the homonymy form ( progressivi_carico_art ).
When the users inserts the quantita_caricata in the form (onAction), the following not global method, which name is: Carica_Progressivo_Relativo_Car , starts.
// Have you memory of the number of records in the actual form.
var num_righe = controller.getMaxRecordIndex() ;
// If it is equal to 1
if ( num_righe == 1 )
{
/* The Progressive Number Relative To The loaded Quantity will be equal To The Loaded Quantity only.
*/
progressivo_relat_quant_caricata = quantita_caricata ;
}
// If it is not equal to 1
else
{
// then go to the previous record on the current displayed form
var prec = num_righe - 1 ;
controller.setSelectedIndex(prec) ;
// Have you memory of The Progressive Number Relative To The loaded Quantity
var progr = progressivo_relat_quant_caricata ;
// Go again to the Last record on current form
controller.setSelectedIndex(num_righe);
/* The The Progressive Number Relative To The loaded Quantity will be obtained from the sum of the Progressive of the Previous record + The Loaded quantity of the actual record
*/
progressivo_relat_quant_caricata = quantita_caricata + progr ;
}
As second action, in order to the goal, i made a form which name is CreaProgressivi (Create Progressive), and which table is articoli (items).
In this form i made 3: first i inserted the fields articoliid and descr_sint(the item briew description); second i made a relation: articoli_to_progressivi_carico_art founded on: articoliid=fkidarticolo ; third i inserted a tabpanel which descends from the relation above.
In this form You are able to observ that when articoliid is inserted, automatically the field descr_sint is populated, and when an action is made on the field descr_sint, a method wich generates a new record in the tab panels starts.
So the tabpanel record is immediately populated in its fkid_articolo, and when the Quantity Loaded is typed in the field quantita_caricata and the field is actionated (onAction), immediately the field of The Progressive Number Relative To The loaded Quantity : progressivo_relativo_quant_caricata, is right populated, so that we perfectly obtained our goal.
II PART.
New goal, to which the first is ordered, is the following.
We also have a Form ordini (orders) in which the portal righeordini (ordersLines) , descending from the relation ordini_to_righeordini is inserted.
Now is required that the order quantity wich we type in the portal:
1.) Adjorn the Loaded Quantity : quantita_caricata in the tabpanel (articoli_to_programma_carico_art). And this adjornment was obtained trought a method that starts when the quantity_ordered is typed in the portal.
2.) Adjorn The Progressive Number Relative To The loaded Quantity : progressivo_relativo_quant_caricata , in the tabpanel. And this is not obtained, also if, sincerly, we’d like that was obtained also for the reason that when the quantity_ordered is passed on the tabpanel , the method Carica_Progressivo_Relativo_Car, which should adjorn The Number Relative To The loaded Quantity : progressivo_relat_quant_caricata, starts immediatly.
But while this form_method , right works if the The Loaded quantity: quantita_caricata is typed in the Form CreaProgressivi (in the tabpanel), it does not right work , i repeat it, if The Loaded quantity: quantita_caricata is inserted from the orders portal.
Could a reason be individuated?
Tanks in advance.
Gianni Pinna