Like any other programming language, Sage X3 also supports functions/methods/subroutines. Though the syntax for defining these functions are different in all languages, the purpose is similar to perform actions and return (or not to return) any result.
But, there are certain subroutines which do not return any value as a result. In Sage X3, these subroutines are called as Subprograms and most of the times called using Call instruction.
Latest versions of Sage X3 provides another instruction to call the subroutines which is as follows:
Callmet INST.METHOD_NAME
Callmet INST.METHOD_NAME(param_list)
where,
INST -> Instance name
param_list -> parameters (if any)
This instruction is similar to Call instruction. Callmet invokes a method on an instance. It is used to invoke methods that do not return any value.
It can contain parameters that can be transmitted as values or as references. The parameters transmitted by reference can be modified by the subroutine.
Snippet:
# Example of SETERROR method call in a control event
If this.AMOUNT=0
Callmet this.SETERROR(“AMOUNT”,”Amount cannot be zero”,20,ASTATUS)
Elsif this.AMOUNT<0
Callmet this.SETERROR(“AMOUNT”,”Amount must be positive”,21,ASTATUS)
Endif
The above snippet will call method SETERROR which contains four parameters but does not return any value.
Here, this is an instance referencing to current object.
Hope this 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 CRM, Salesforce.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.
Also Read: