Disabling access to transactions using 4GL in Sage X3

By | November 28, 2023

Many times we need to restrict access for transactions based on some requirement and for doing that Sage X3 provides ways from application setup. However, we as developers also have control with the 4GL (Safe X3 console language) to add more in depth conditional requirements which sometimes with setup is not achieved.

To know more about this, we’ll show a small example of how we are restricting access for a specific user code on Sales Order transactions via 4GL.

For this we’re referencing following paths and screenshots below:

Sales Order: All > Sales > Orders > Orders (GESSOH)

New Stuff: Sales Order updation in Sage X3 using EDI 860 documents

Fig. 1 - Original transactional access to ADMIN on Orders
Fig. 1 – Original transactional access to ADMIN on Orders

-As shown in Fig. 1 we can see the original access list for ADMIN user code on Sales orders. There are a total 6 transaction types available to open Sales Order Transaction.

Fig. 2 - Snippet on code
Fig. 2 – Snippet on code

-Now using the 4GL editor we’ve written the logic on Fig. 2 as shown. We wanted to give access to only ALL & SAL transactions within the selection to ADMIN user code. The above logic helps us achieves that and can be modified as per your own requirement.

Fig. 3 - Descriptive error for user
Fig. 3 – Descriptive error for user

Fig. 4 - Restrictive transactional access for ADMIN on Orders
Fig. 4 – Restrictive transactional access for ADMIN on Orders

This way we can implement advanced restrictions on transactions using 4GL in Sage X3.