aamir_faried
29th October 2009, 09:47
In a session when I add one row and press save button, I can get variable values in script and can manipulate and have logic according to variable values. It works perfect.

But when i enter two rows in session (customized) and press save button, I am not getting values of second row only but cannot get values of first row. Could you please help to me how can I get value of first row?

rberti
29th October 2009, 12:35
Considering that you are not programming at the table's DAL, you can use "do.occ()"
Take a look:

SSA ERP LN 6.1 Programmers Guide


do.all.occ()

--------------------------------------------------------------------------------

Syntax
void do.all.occ( function_name [, ... ] )

Description
This executes the specified function for all occurrences on the current form. When included in the before.choice subsection of a choice.update.db section, the function is executed only for occurrences that are pending to be saved.
If the update.status has not yet been set, then do.all.occ() will first lock all records. After the function has been executed for all occurrences, all fields of all occurrences are redisplayed.

Arguments
function_name
The name of the function that must be executed. The function must be of type void.

...
Use these optional arguments to pass one or more arguments to the specified function. Use commas (,) to separate the arguments.


Context
4Gl library function.

You can use this function only in 4GL scripts of types 1, 2, and 3. You can use it in the following event subsections:

before.choice, on.choice, after.choice
before.input, on.input, after.input, check.input, when.field.changes
before.zoom, after.zoom

See also
do.occ(), do.occ.without.update(), do.selection(), on.old.occ()

Example
declaration:
long old.inventory

choice.cont.process:
on.choice:
do.all.occ(update.occurrences, 9999)

main.table.io:
before.rewrite:
on.old.occ(get.old.inventory)
pctst999.change = pctst999.item - old.inventory

functions:

function void update.occurrences(long new.val)
{
pctst999.special = new.val
}

function void get.old.inventory()
{
old.inventory = pctst999.item
}