Hi All!
How can I validate a string control content? The scenario is as follows:
In the VendTable form there's a combobox control with the category of
the vendor (company, person, none, foreigner). I need to check if the
next field (named CNPJCPFNum in localized AX 3.0 SP5) is empty ONLY IF
the category (the preceding field) is set to company or person.
If it is empty/blank (if the user didn't input anything in the
CNPJCPFNum control) I need to pop up a box::stop dialog.
I tried to override the CNPJCPFNum control's leave method and put the
following code in it (and breakpointed it) but when I TAB through to the
next field nothing happens (no dialog and no debugger).
Anyone?
The code:
--------8<---BEGIN----8<----------
public boolean leave()
{
boolean ret;
ret = super();
if (element.design().controlName('National1_CNPJCPFNum').valueStr()
== '') {
if ((vendTable.VendCategory == CustVendCategory_BR::Company)
|| (vendTable.VendCategory == CustVendCategory_BR::Person)) {
box::stop('@WKL51', '@SYS59975');
element.design().controlName('National1_CNPJCPFNum').setFocus();
}
}
return ret;
}
--------8<---END----8<----------
|