Reference Qualifier on Variable Set based on Variable on the record producer

shri5
Mega Guru

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.

 

 

4 ACCEPTED SOLUTIONS

shri5
Mega Guru

Hi all,

 

Thanks for your reply.

This issue has been resolved, thanks for your value able time to reply on the same.

 

Regards,

Shrikant.

View solution in original post

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.

View solution in original post

Prahlad Kumar
Tera Guru

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

View solution in original post

8 REPLIES 8

Sruthi17
Kilo Sage

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.

 

manjusha_
Kilo Sage

@shri5 

 

Please specify type of variables policy type and policy number.

What exact filter you want to apply ,share screenshot 

 

Thanks,

Manjusha 

shri5
Mega Guru

Hi all,

 

Thanks for your reply.

This issue has been resolved, thanks for your value able time to reply on the same.

 

Regards,

Shrikant.

Siva Jyothi M
Mega Sage

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.