How to avoid invalid reference if any junk value is given in catalog reference field (non-mandatory)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2017 11:09 AM
Hi,
I have a reference field which is not mandatory on the service catalog. If i give any junk value it accepts and allows submission.
Is there any way to restrict this through onChange or onSubmit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2017 11:39 AM
Reference fields by default will only accept valid values. What will happen is that the invalid value doesn't match then that field isn't filled in upon insert/update. Now if that reference field was mandatory then it will not accept junk and you will get a message saying that field is mandatory.
Now this said there is an attribute you can add to the dictionary record of the reference field to automatically add new values to the referenced table. I mention this in case yours is setup this way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2017 11:53 AM
Hi Michael,
The reference field table name is change_request. If we add some value junk value like "aaaa bbbb ccc" then it doesn't make sense to add these new values to the referenced table. I am looking for some kind of validation at client or server side to avoid such submission.
Thanks,
Mohiuddin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2017 12:42 PM
OK by default if you enter junk the junk value is NOT added to the reference table - you have to set that up. But if you enter junk and click submit/order or whatever it won't set that referenced field with a junk value. So there isn't a need for a client or server validation since its not accepted.