Pattern Matching in Sage X3

By | March 21, 2014

You may often need to write a code that performs inexact pattern matching. The use of “PAT” allows you to find data that fits a certain pattern, rather than specifying the code exactly.

New Stuff: Sage Introduces New Enhancements for Sage ERP X3 v6.5 (Patch 27)

Syntax

pat( expr_c, pattern )

Where “expr_c” is an alphanumeric expression defining the string whose compliance is to be tested with the pattern given. And “pattern” is an alphanumeric expression defining the compliance pattern.

PAT is used to check compliance of a character string with a given pattern. This compliance uses the following conventions for the patterns:

  • The character ‘*’ represents any number of characters, even null,
  • The character ‘?’ represents precisely one character,
  • The character ‘#’ represents a digit,

For example,

You may also combine these characters in complex patterns to perform more advanced queries. For example, supposedly you needed to write code for checking whether user is entering proper Email address or not. You could use the following Code:

If not(pat([M:ABC]EMAILID,”*#@*.*”))

Infbox(“Wrong Email address”)

Endif

All the other characters in a pattern must exist in the character string to be checked so that compliance may be recognised.

PAT returns an Integer type result: when the string is compliant, PAT returns 1, otherwise a 0.

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, 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.