umadevi
15th September 2009, 06:01
Hi all,

Plz Help me.

I am calling the customised session(maintain session) from the Maintain receipts session.Index on My customised table is receipt+order (unique) . i am importing the values of receipt number and purchase order from maintain receipts.Now what i want is if the record present in my customised table it should display in customised session ,otherwise it should insert in table through customised maintain session.


What should be the start option of customised session

How to display if the record exists

Thanks in Advance

Regards,
Uma

manish_patel
15th September 2009, 07:52
In init.form subsection first check whether record is exist for receipt+order combination or not. And then use execute(long choice_option) function to execute relevant choice options (i.e. def.find, add.set).

Sample Code:
before.program:
|*** importing the values of receipt number and purchase order

form.1:
init.form:
if record.found() then
execute(def.find)
else
execute(add.set)
endif

functions:
function long record.found()
{
if record exists then
return(true)
endif
return(false)
}