RobertP
10th August 2022, 15:01
CE (cloud edition)

We developed 2 tables & sessions in the TX package.

Session 2 contains history of session 1 'batches'. Naturally when user zooms from session 1 to session 2, the currently selected batch should be transferred to sess 2 or else the batch should be reentered by user. For this we used export() and import() [supported by put.var() and get.var()]

In CE the zoom process fails with error "put.var() cannot be used in untrusted environment". How are we supposed to automate navigation between custom sessions in CE?

Thanks

JaapJD
11th August 2022, 17:13
put.var() to a tx-session is supported according to the programmers manual (a tx-session is a non-trusted process).

RobertP
12th August 2022, 12:16
Double checked the manual Jaap.

put.var:
This function is marked as 'untrusted' and can therefore only be used in trusted objects. More about trusted and not trusted objects can be found in the section about managed execution..

Therefore get.var / put.var [ or import() export() ] cannot be used in CE package TX. My questions remains. How to automate navigation between custom sessions developed in CE tx package?

Imagine table 1 - Batches. Table 2 - Batch history. Zoom from batch to Batch history. Now user has to re-enter the batch number because export() import() are blocked.

I did not get a clear understanding of your reply. Could you elaborate?
Cheers

JaapJD
12th August 2022, 12:25
This is in my version of the programmers manual:
This function is marked as 'conditionally trusted' and can therefore only be used in trusted objects or 'conditionally' in not trusted objects. In the following case it is possible to use this function in a not trusted object: TIVLevel >= 2120 and processno is a non trusted process.
get.var() and import() is never a problem. And you don't need to export from session 1 before you zoom to session 2. Just import the value of the table 1 field in session 2.

RobertP
13th August 2022, 12:07
Thanks a stack Jaap. Never considered only using import(). Will check and confirm...

JaapJD
15th August 2022, 09:35
One additional remark. If you use export() in session 1, it does a put.var() to its parent. And that is definitely not a tx-session! So, that is the reason that it fails at runtime.