- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 03:47 AM
Hi All,
I have a record producer with few variables and a variable set. A variable named 'Client name' is created as a variable and the Variable set has Policy details.
Requirement is - based on the Client name selected in the 'Client name' field, the policy type and policy number should be filtered. I have tried writing a catalog client script on the variable set; however Variable on the form is not available to write Onchange/ Onload while writing the script on variable set. Any help on this is much appreciated.
Solved! Go to Solution.
- 3,017 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 09:52 PM
Hi all,
Thanks for your reply.
This issue has been resolved, thanks for your value able time to reply on the same.
Regards,
Shrikant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 03:38 AM - edited 09-08-2023 03:39 AM
As the "client Name" was variable on catalog Item and Policy details (Policy-reference field,Policy Number and Policy End date) are variables part of variable set. We can't directly access variables value in variable set. (One client has many policies, and each policy as respective number and end date).
So, catalog client script(onchange) written which was passing the value "client Name" to the script Include(client Callable). In the
script include the related client name list of policy fetched and By using gs.getSession().putclientData('keyWord', answerOf ScriptInclude);
And to pass this policy list to policy variable in reference qualifier. Reference qualifier which calls Script Include which access data as gs.getSession().getClientData('keyWord') assigned to variable and returned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 04:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 04:55 AM
Hi @shri5
The following catalog client script will filter the policy type and policy number based on the Client name selected in the Client name field:
function onchangeClientScript(context) {
// Get the Client name value.
var clientName = context.getVariable("Client_Name");
// Get the Policy type and Policy number fields.
var policyTypeField = context.getControl("Policy_Type");
var policyNumberField = context.getControl("Policy_Number");
// Clear the Policy type and Policy number fields.
policyTypeField.clearValue();
policyNumberField.clearValue();
// If the Client name is not empty, filter the Policy type and Policy number fields.
if (clientName != "") {
// Get the list of Policy types and Policy numbers for the Client name.
var policyTypes = [];
var policyNumbers = [];
// For each Policy type, check if it is associated with the Client name.
for (var i = 0; i < policyTypes.length; i++) {
if (policyTypes[i].Client_Name == clientName) {
policyTypes.push(policyTypes[i]);
}
}
// For each Policy number, check if it is associated with the Client name.
for (var i = 0; i < policyNumbers.length; i++) {
if (policyNumbers[i].Client_Name == clientName) {
policyNumbers.push(policyNumbers[i]);
}
}
// Set the Policy type and Policy number fields to the filtered list of values.
policyTypeField.setValue(policyTypes);
policyNumberField.setValue(policyNumbers);
}
}
This script can be added to the Variable set that is used to create the catalog item. When the Client name field is changed, the script will filter the Policy type and Policy number fields to the values that are associated with the Client name.
Please mark it as helpful if it helps you to resolve the issues.
Thanks
Prahlad Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 04:05 AM
Hi,
Dont write a client script for that variable set, instead create a catalog client script for the catalog item, so that you will be able to access all variables and variables inside the variable set.
Please accept solution or helpful, if you find it helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 04:06 AM
Please specify type of variables policy type and policy number.
What exact filter you want to apply ,share screenshot
Thanks,
Manjusha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 09:52 PM
Hi all,
Thanks for your reply.
This issue has been resolved, thanks for your value able time to reply on the same.
Regards,
Shrikant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 09:57 PM
Hi @shri5,
It will be helpful for others if you mention what worked for you.
Mark this answer as correct and helpful if it solves your issue.
Regards,
Siva Jyothi M.