How to Link and Order with Different Tables in 4GL

By | April 30, 2015

You may come across a situation, where you may want to link or ‘order by‘ with different tables. X3 has the solution for the scenario and it will help us to get the value from linked tables and be able to sort by descending and ascending order on each field. Please refer to the below screenshot to get a better understanding,

New stuff: How to setup timeout in X3 and stop executing the code when timeout occur…?
5

Description of Screenshot:

  • STO1 is alias of First table
  • TLO1 is alias of Second table
  • Link both tables with proper Key/Index with alias name [STO2] Link [STO1] With [TLO1]TLO0=STOFCY;LOCTYP As [STO2]
  • Now use the where clause to filter the First table include the order by clause too
    Filter [STO2] Where ITMREF=’33301′ & STOFCY= ‘P33’ Order By [TLO1]LOCTYP Asc;[STO1]LOC Desc
  • Please note here, that we should mention the actual table name with the field in the order by clause, so it will not conflict with the ambiguous column name.
  • Finally, we got the data from both tables after filtering and sorted,
    Infbox num$([F:STO1]STOCOU) # data comes from First table
    Infbox num$([F:TLO1]LOCTYP) # data comes from Second table

About Us
Greytrix – a globally recognized Premier Sage Gold Development Partner is a one-stop solution provider for Sage ERP and Sage CRM needs. Being recognized and rewarded for multi-man years of experience, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation expertise.

Greytrix caters to a wide range of Sage Enterprise Management (Sage X3) offerings – a Sage Business Cloud Solution. Our unique GUMU™ integrations include Sage Enterprise Management (Sage X3) for Sage CRMSalesforce.com, and Magento eCommerce along with Implementation and Technical Support worldwide for Sage Enterprise Management (Sage X3). Currently, we are Sage Enterprise Management Implementation Partner in East Africa, Middles East, Australia, and Asia. We also offer best-in-class Sage X3 customization and development services, integrated applications such as POS | WMS | Payment Gateway | Shipping System | Business Intelligence | eCommerce, and have developed add-ons such as Catch – Weight  and Letter of Credit for Sage Enterprise Management to Sage business partners, end users and Sage PSG worldwide.

Greytrix is a recognized Sage Rockstar ISV Partner for GUMU™ Sage Enterprise Management – Sage CRM integration also listed on Sage Marketplace; GUMU™ integration for Sage Enterprise Management – Salesforce is a 5-star app listed on Salesforce AppExchange.

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