jatin_sanghi
29th October 2009, 06:23
Hi All,

I'am trying to write some logic in before.rewrite section of main.table.io in LN session.

I had earlier written that logic in dal of maintable in "before.save.object()", but i need to transfer it to main script of session. I have removed the dal logic and compiled. But still "before.rrwrite" sesction is not working.
I have even tried to restart the shared memory, but to no use.

Is there some issue in LN, that doesn't allow maintable io section to work if a dal is placed, though it doesn't have any related functions.

regards,

Jatin

ulrich.fuchs
29th October 2009, 08:33
You did it in the wrong direction :-) Such a logic belongs to the DAL in ERP LN. As soon as a DAL exists(!), sections like before.rewrite are not executed any longer, and there is no way around this. Start thinking in Data object (DAL) actions, not in user actions! It makes the code a lot more maintainable and reusable.

If you need different functionality depending on prior user input, use a global control variable in the DAL that you can set by a business method (simple external function in the DAL), which you call from your session script by dal.start.business.method (...)

The very dirty way is to make the DAL (or also a User Exit script) behave differently by directly checking the session code which it is used by, using something like:

domain tcmcs.str16 sessname
get.var (pid, "prog.name$", sessname)
if sessname = "..." then....

Hope that helps
Uli