How to validate alphanumeric date field in Sage X3?

By | February 9, 2016

There can be occasions when you want to accept date input in an alphanumeric field in grid. As, alphanumeric field does not have calendar control so you need to validate the entry section by writing our own code. Here we are describing how to achieve same via code.

Below is the code we have written after changing event of alphanumeric date field

Subprog AM_DATASW10(VALEUR)

Variable Char    VALEUR()

Global Char XDATE:XDATE = ”

Call DATEVALIDATE(VALEUR)

If VALEUR <> ” and XDATE = ”

  mkstat=2

ELSE

   [M:ZTEC]DATASW10(nolign-1)=xdate

   Affzo [M:ZTEC]DATASW10(nolign-1)

Endif

XDATE = ”

End

#####################################################################################

subprog datevalidate(VALEUR)

global char xdate:xdate=”

local char LC2:LC2=”

xdate = format$(“DD2”,VALEUR)

LC2= format$(“DD2″,”gfdbf”)

if xdate = LC2

 infbox ‘Invalid date’

 xdate = ”

endif

end

####################################################################

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 customizations, data migration, 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.