Fetch 'Template values' from sys_template table and store the values in catalog item fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 02:27 AM
My Requirement is I have a field called 'Select Template' on a catalog item which is reference field to sys_template table. When I select any template the template values should be auto populated in catalog item fields on catalog form.
i wrote below catalog client script:
function onChange(control, oldValue, newValue, isLoading) {
if(isLoading || newValue == ''){
return;
}
var template = g_form.getValue('Template');
if(template != '')
//Apply the selected template
applyTemplate(template);
}
But this is not working as expected. Since the template values are stored as XML attached in the screenshot. I want to extract the values from template values and split them separately to populate the values in catalog item fields.
Finally I want to populate catalog item fields whenever I select a template.
Please can anyone help me out to write catalog client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 06:02 AM
Can we use Script Include and Catalog client script for this setup.