Advanced Embedding of SEI in X3

4 minute read time.

In the other blog, "Embedding SEI in X3", we illustrated one way to easily embed SEI in X3. That was by creating a gadget with link type "External link", entering the complete URL for the SEI view and then creating a home page. to display the gadget.

In this blog I show you a more advanced method of embedding SEI in X3 requiring some bit of development.

Tangarine supplies two patch files with every release of SEI since X3 V9 to be patched into X3 if you wish to use this method of embedding SEI. Below are the files from SEI release 2022 R1.5

Before patching these into X3, the steps outlined on the other article for preparing x3 for embedding SEI have to be followed.

That is:

1. Modifying nodelocal.js with this stump provided by Tanagarine.

2. Making SEI entries on the X3 External URL policies

3. Being wary of the updated Web Browsers  Cookie management policy. The changes to be applied to your Web Client if you want SEI embedded into your ERP website, or you want to use Single Sign-On (SSO) are outlined in this link https://onlinehelp.sageenterpriseintelligence.com/Latest/en/Installation/cookie-management.htm.

4. Then you are ready to patch up your application folder with the two patch files from Tangarine.

Copy the files into a convenient folder

Open the patching function in X3. Apply both patches to the application folder only as shown below.

The patches add two elements; a screen and 4GL code linked to an action on the screen. 

(1) The screen is ZBITGEX of Size "Tab", a Block type "Browser" in the blocks section and a parameter ZDOC as highlighted below.

There are just two fields, ZDOC & ZDOCORI.  ZDOCORI is hidden.

ZDOC has an action ZURLMAKER linked to it of type Initiailisation.

We will see how these fields play out in the supplied subprogram linked to the action.

The action ZURLMAKER puts together (makes) the SEI URL from the action parameters, for the view or report that will displayed in the browser.

As a reminder from the other blog, to get the SEI URL, open a view in SEI and go to "Sharing" on the right hand panel of the screen, and then "View external Link"

The URL  http://x3erpv12sqlvm:81/StandAlone/Index?PID=490000454&VID=490000426&envID=e2d8dcf6-ad78-4d9d-b996-163fe39b018b&OpeningAction=OpenView&CP=f882db69

will be buiilt by the action ZURLMAKER.

First of all, in X3, in General parameters, envID=e2d8dcf6-ad78-4d9d-b996-163fe39b018b from the URL highlighted below must be entered into general parameter ZBIURLEID

and http://x3erpv12sqlvm:81 (for my installation, yours will be different) on general parameter ZBIURLSRV.

The parameters PID=490000454 and VID=490000426 on the URL come from SEI and refer to the Data Model and view respectively.

If you hover your mouse pointer on the SEI view, you will see PID and VID

PID and VID are entered on the Action parameters ZURLPID and ZURLVID for ZURLMAKER as shown below.

The rest of the action parameters are as follows:

Action Parameters Description
ZURLDES Value sent to ZURLMAKER. (no change)
ZURLFLD* Identifies SEI in the field used for the filter (Table.field).
ZURLKEY* Identifies Sage X3 in the corresponding filed serving the filter ([mask]field).
ZURLPID Identifies the SEIData Model.
ZURLVID Identifies the SEIView.

ZURLDES must not be changed. Leave as is, [M]DOCORI.

For ZURLFLD* parameters, open the SEI Data model from which to obtain table fields. For this example, I opened the Sales Cube Data Model,

from which I picked the table SOLDTOCUSTOMER, fully qualified as X3SALESX.SOLDTOCUSTOMER.

The action fields ZURLKEY* are for filtering. In my current example, I want to view the top 5 products for a particular customer. I need the freedom to select customers.

This is done through ZURLKEY* = [M:BPC0]BPCNUM, which is the customer identity on the screen BPC0.

For this example, the screen ZBITGEX has been duplicated as ZBITGEXA. This is so that the original screen ZBITGEX is always available to copy and rename for one's particular customisations.

The screen ZBITGEXA is added to the customer Window OBPC, where the filter field  [M:BPC0]BPCNUM for ZURLKEY1 is located.

We validate the window OBPC and then open the function GESBPC and we'll see the top 5 products for the customer on the added tab, SEI Top 5 Products.

The URL displayed while on the added tab is 

http://x3erpv12sqlvm:81/StandAlone/Index?PID=490000454&VID=490000426&envID=e2d8dcf6-ad78-4d9d-b996-163fe39b018b&OpeningAction=OpenView&TPDOCID=localhost&F=X3SALESX.SOLDTOCUSTOMER%20%3D%20%27NA001%27

See if you can figure out how the 4GL code below put together the above URL. You will find the code in the ...\SEED\TRT\  folder( your application folder for SEED).

Have fun embedding SEI in X3.