IDC String Functions correct usage

We have vendors that send in both the PO with the line and other characters like / or - on the invoice.
For whatever reason the regions will not learn or keep to only grab the first digits.

I am trying to use a formula to just grab the first 5, but it does not seem to work. In this case the field on the invoice is 51702-1 and this is the error on the field in Verify.

The PON value is not equal to ‘51702’ in formula ‘STRLEFT(SELF,5)’
From the documentation I would have thought it would modify the field, but it appears to be doing a validation?

I agree that formula should work. Are the Calculable and AutoCalculate flags set? (it doesn’t look like it)

1 Like

That was it, now there is no error after selecting the correct items.

1 Like

Happy to help!

Any benefit to using SELF in that formula instead of the explicit field ID, FT_PON ?

None of the formulas in my IDC DFDs were configured using SELF, so I was just curious.

Not that I know of, it just happened to be what I was last testing with. Here is what the Ancora site says.

Special Variables

SELF

The SELF variable to used to reference the literal value in the field at the time the formula is evaluated and executed. This is always used in conjunction with logical functions For example, the formula below can be interpreted like this: If there is a value in the FT_TAX field then the Grand Total field is populated with FT_SUBTOTAL + FT_TAX, if there is no value in the FT_TAX field then the Grand Total will not be calculated; its original value (SELF) will be used for the field instead.
IF(VAREXISTS(FT_TAX),FT_SUBTOTAL + FT_TAX, SELF).

NOTE: when using SELF in a formula it is case sensitive.

1 Like