Questions How to create a visible expression that uses Contains or StartsWith
I would like to be able to control the visibility of a field on the SO Invoice (SO643000) using a contains, like, or startswith filter. I have not been able to get the syntax right. 'Like' using SQL syntax gave an unsupported error.
=[ARInvoice.CustomerLocationID] StartsWith ('W/C?') will not validate and says Missing operator before the StartsWith operand. Same if I use Contains.
I tried this and it basically ignores it:
=[ARInvoice.CustomerLocationID] = 'W/C?'
Can someone help with the correct syntax and which one works (contains or startswith)?
You can use the "InStr()" function to find strings within strings. It returns the position within the source string where the string to find exists. If it is not found, the function returns -1. The first position of the source string is 0.
1) To look for "xyz" anywhere inside field [EPEmployee.AcctName], use the following - if the result is -1, it wasn't found; if the result is >=0, that's where it was found:
2) To look for "xyz" only at the beginning of the field, use the following - if the result of the expression is False, it wasn't found at the beginning; if the result of the expression is True, it was found at the beginning: [use this for your Visible Expression]
You could even use the Left() function in the visible expression.
=Left([DAC.FIELDNAME],1)='W' or Left([DAC.FIELDNAME],1)='C'