Setting Template Field Value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 08:35 AM
Hi,
I need to setting defalut value for the template field whenever a new template is created.
I create after update business rule.
(function executeRule(current, previous /*null when async*/) {
if(current.isNewRecord() && current.table=='incident')
current.template('u_template_name_used',current.name);
})(current,previous);
This doesnt to set the value after i submit the new template.And also i want the fields to remain set which i have already choose for templae field.
Please help.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2018 04:18 AM
Then you must join strings with javascript variables properly with +
current.template = 'u_template_name_used=' + current.name + '^' + current.template;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2018 04:29 AM
Thanks a lot ! It works.
can you please help me in one more stuff..
Actually i track how many times a template is being used in incident form by using count field. and sort it against count field.
do you have any idea about sorting.As of now i have updated ui macro template_context for this.it sorts but only when i opened the list of template.