How to Open a Screen, when Single Object is bound with Multiple Screens?

By | August 25, 2016

If we want a particular screen to open among several screens, where single object is bound with the multiple screens then Sage X3 provides a functionality for the same.

To access screen using Code check below link:

– https://www.greytrix.com/blogs/sagex3/2014/01/30/how-to-access-screen-using-code/

Now, let’s see how we will get the required screen based on certain conditions. If you have variable R1 and based on its value, you want to open an object based screen, where object is bound with multiple screens. E.g. take object as BOD which is bound with Commercial BOMs and Production BOMs.

Let’s say we want to open the Commercial BOMs screen when R1=1 else open Production BOMs screen.

Here is code:

If R1 =1

    Local Char PARBOUT(250)(1..20)

    Local Integer FLGEXE : FLGEXE = 1

    PARBOUT(1) = “”

    PARBOUT(2) = “BOD”

    PARBOUT(3) = “”

    GACTION = “GOBJETC1”

    GFONCTION = “GESBODC”

    GFONBOD=”BOMC”

    GDATEREF=date$

    Call OBJET_CHAR(PARBOUT(1),PARBOUT(2) ,PARBOUT(3)) From GOBJET

  Else

    Local Char PARBOUT(250)(1..20)

    Local Integer FLGEXE : FLGEXE = 1

    PARBOUT(1) = “”

    PARBOUT(2) = “BOD”

    PARBOUT(3) = “”

    GACTION = “GOBJETC1”

    GFONCTION = “GESBODP”

    GFONBOD=”BOMP”

    GDATEREF=date$

    Call OBJET_CHAR(PARBOUT(1),PARBOUT(2) ,PARBOUT(3)) From GOBJET

  Endif

Explanation: If we noticed the code is same as opening the normal screen except few additional parameter where set is GFONCTION, GFONBOD, GDATEREF.

Setup:

1) GFONCTION: In GFONCTION, set the function code of the screen which supposed to open, Say function code for opening the production screen is “GESBODP”.

2) GFONBOD: GFONBOD is a global variable, which is generally included in the variable section of the function and its value varies. GFONBOD variable is just name, you may create your own variable and use that variable in different functions, usually we create such variable to link a set of screen which we are supposed to open based on function code and variable value.

GFONBOD set

 

Say GFONBOD value for opening the production screen is “BOMP”.

3) GDATEREF: It’s just another global variable where we have to set its value to the current date.

4) PARBOUT(2):  It consists of an object code, which may bound with set of screens.

Hope this blog helps!

About Us

 

Greytrix is one stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product, system integrations, third party add-on development and implementation expertise.

Greytrix have some unique solutions of Sage X3’s integration with Sage CRMSalesforce.com and Magento eCommerce. It also offers best-in-class Sage X3 customization and development services to Sage business partners, end users, and Sage PSG worldwide.

For more information on Sage X3 Integration and Services, please contact us at x3@greytrix.com .We will be glad to assist you.

Other Related Blogs:

– How to open the object managed screen via code?

– How to access screen using Code?

– Passing Parameters to your Pop Up Window in Sage X3

– How to open Sage ERP X3 Code file in eclipse folder in version 7