Attribute for Multi Line Text Variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 08:43 PM
Hi
Can we define attribute for multi line text variable ?
If yes, please explain me this..
Thanks in advance.
Regards,
Abhishek
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 09:27 PM
Hi,
Don't think so, Variable Attributes feature are supported for Multi Line Text Variables. if you need to have Attributes Validation like Max length or any other property, can be done via using DOM as explained below:
You can write an On Load Catalog Client Script as mentioned below for Reference where I am checking the Max Length a User can enter in the Multi Line Text Variable:
Script:
function onLoad() {
var i = document.getElementById('IO:4e92cf349f203100d8f8700c267fcfe4'); //variable name
i.maxLength = '10';
}
Similarly you can do for other Attributes you require.
Note: DOM is not recomended to use as a Best Practice as it can break in future Upgrades due to change in Element ID of the Variable you are using.
Hope this helps. Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 09:47 PM
Thanks for your help.
This is working for normal catalog item page, but when I try it in Service Portal page it is not working.
As we know that DOM element method getElementById() does not work for Service portal. Please correct me if I am wrong.
Thanks and Regards,
Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 09:44 PM
Hi Abhishek,
It is not possible.
Attributes field visible only to the following variable types: Reference, Lookup Multiple Choice, Lookup Select Box, List Collector, Single Line Text, Wide Single Line Text.
If you do not see the Variable attributes field, then enable the Show attributes when Type is One of Certain Values UI policy.
But still you can't set the attribute value because this value are not applicable with Multi line Text.
you can set the limit using catalog client script.
You can use wide line text then it applicable.
Thank you!