sgoupil
20th April 2018, 10:55
Hello, I want to do some validation in a DAL (tisfc001ue), in order not to validate everything, I need to do the validation only when trying to complete a production order. Session tisfc0120s000 is the one that is being used for it.

In the DAL, I use import("prog.name$", sess.id) function in order to store the calling session in the sess.id variable. This does not retrieve the proper information. If, for example, I am in the Production Order session (tisfc0501m000, I can access the Report Production Order Complete (tisfc0120s000), but this function returns tisfc0501m000 instead of tisfc0120s000. Samething if when in tisfc0501m00, I double click to open a single occurrence of a production order, I get in session tisfc0101m100, from there, if I open the session Report Production Order Complete (tisfc0120s000), again, in the DAL, the function retrieves tisfc0101m100 instead of tisfc0120s000.

Someone knows a different way so I could really retrieve tisfc0120s000? Thanks.

JaapJD
20th April 2018, 11:03
The import() function retrieves the prog.name$ of the parent process. If you want to have it from the current process, use

get.var(pid, "prog.name$", sess.id)

hklett
20th April 2018, 12:58
I think you can access the prog.name$ variable direct, because it is an external variable which is global inside of the process.

BaanInOhio
20th April 2018, 15:14
Write a DLL function that does the assignment of the program name and pass it back to the caller. The prog.name$ variable is present since it shows up in the debugger as valid - you just can't use it in a compile. If you do it in a separate external function, you get both the ability to compile and the variable contents:


function extern domain tcsess get.program.name.in.dal()
{

domain tcsess out.sess

out.sess = prog.name$
return(out.sess)
}


Infor probably does this to discourage use of session-related logic in DALs. This works in DAL, DAL2 and UE scripts.