Question

client script - validate string on spaces

  • 28 February 2023
  • 1 reply
  • 48 views

Userlevel 2
Badge +9

Hi All,


I need to detect if a field in mobile isn’t contains only spaces. 
I want to do this via a script, I know this is easy to achieve via Javascript, but I understand vanilla Javascript isn’t supported in FSM? I’m only allowed to use the build in functions from IFS? 

Regards,


1 reply

Userlevel 6
Badge +26

Hey @drooij 

You are correct, JavaScript is not supported by IFS platform. You need to use the internal API which has JavaScript like syntax.

One idea you can try

Create an SQL script to check if the field value has spaces in it.

select count(*) from <YOUR_TABLE>
where <YOUR_COLUMN> like '% %'
and <YOUR_COLUMN_ID> = <ID>

Then check if the result has any value larger than 0.  If result is bigger than 0, there are spaces in the field value, else no spaces.

I believe there are more/other ways, but this is the first thing that came into my mind.

Cheers!

Reply