cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Validate a field

Former Member
0 Likes
288

Hi

We are trying to validate a field in VC UI.

Validation required is the entered value should be part of an output list of a webservice executed.

In detail: a webservice is executed at page load which returns a plant list.

Now when a user fills in the field for plant input, it should not allow any value which is not returned by the webservice.

I am trying to use the validate field option at the bottom of the layout for the field properties.

But no clue on how to use this service, not triggering it every time a value is entered.

Lavanya

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Likes

The value in the text boxonce validated it gets added ot a table.

If I pad the value of the text box that is how it will be displayed and the added to the table, but the users do not want to see extra zeroes.

Is there a way to temperorily store the value with zeroes, validate and then add it to the table as it is.

One way could be to put a hidden text box to store the temp value, any other smart way?

Former Member
0 Likes

As I mentioned, webservice pads the code to 18 digits with 0s.

But the user will enter only enter the code which could be 9 digits or 10.

If we know specifically it is 9 we might take the last 9 digits of the returned value to fill the drop down list.

But that is not static.

Former Member
0 Likes

In this case, Count the length of input value (count@plant) and if the count is 9 then padd 10 if the count is 10 the padd 9 '0'.

Former Member
0 Likes

I missed to mention the actual challenge. The webservice returns 18 digits value whereas the user will enter only 9 digits teh rest have to padded with '0's and it should not be visible to the user either, i.e., we cant convert the value in the text box or list box to 18 digit for further use. We have to temperorily convert them to 18 digits only to verify if the code exists in the list.

anja_engelhardt2
Employee
Employee
0 Likes

How about the drop down box? Why don't you use this? Is there a special reason?

Anja

Former Member
0 Likes

Hi Lavanya,

To select the fields from the list flexibly to the end user we can suggest dropdown box would suite,In this case,no poor in application performance.

Hope this may help.

Rabert.

anja_engelhardt2
Employee
Employee
0 Likes

Hi Lavanya,

in the validation part you can enter some rules. In this dialog you need to define the condition and a value. For the value you can also define an expression. I think in your case you will need it to check whether the value entered is part of the list.

Nevertheless this validation will be done every time a value will be entered for the specific fields. So this is exactly that you've been afraid of. Another idea would be to do a kind of 'manual' validiation (so this means you need to model this by yourself) before saving the new data to the backend. Maybe have a popup that tells which values are wrong and what to choose instead.

Or don't use a text field but a drop down list filled by the values of your webservice or something like this. So your users won't be able to fill in anything different than you'd like to.

Regards

Anja