How to run a form from within a report ??

Hi i want to run a form from within a report. I am using the report to import the data from an excel sheet. Once the data is imported into navision table, i want to show the imported data in a form to the user for his approval. for this i put the following code in onpostreport trigger:[formnumber],[record variable]);

as a result the form seems to be running but it doesnt hold on the screen, it feels as if it flashes away.

Please help!!

Try using form.runmodal

Hi Sangam,

Can you post the code?

Hve you tried using FORM.RUNMODAL ?

Sorry Alexander - didn’t see you post

he he,

busses… remember [;)]

i m actually inserting a record into a table in the prereport trigger, using the record variable of the same table.

i removed and now i have the following code in OnPostReport trigger:

form.runmodal([form number],[record variable]);

but now i m getting the following error message on runing the report:

The following CAL funciton(s) can be used only to a limited degree during write transaction(s) :

Form.RunModal() is not allowed in write transaction(s).

please advise!!

Hi Sangam,

You have inserted the record but you need to COMMIT them to the database first before seeing them in the form

Hi Sangam,

This error can be overcome by doing a COMMIT before the FORM.RUNMODAL (as i think the error also suggests)

However, as you want to present the imported data to the user, for his/hers approval before writing it to the DB, you have to modify the behavior of the import, rather than doing a COMMIT.

What i think you should do, is to import the data into a temporary record-variable.
Then run the form on the temp-rec instead.
Then if the user presses OK (which i expect is how he/she indicates that the record is OK) in the form, you then transfer the temporary record to the actual table.
This can be achieved by wrapping your RUNMODAL in an IF/THEN-statement.

Hi Alexander,

Thanks for your valuable solutions.

Could you post me the code please and where should I insert the code. I tried to write the code in the table’s OnInsert() trigger but it donot work.

Thanking you!