Highlighted
Respected Contributor.
Respected Contributor.
293 views

How to update drop down values automatically.

Hi Experts,

 

There is a field called ‘Install Team Priority’ on incident form, which will show values whose active status is true.

Form Screen Shot:

dropdown view.png

Table screen shot:

TableScreenshot.PNG

When I select a value from drop down list, its corresponding ‘active status’ become false.

Now when I open a new incident in ‘Install Team Priority’ drop down list, it should show values whose active status is true.

But for me the value which got updated to false is also showing in drop down list for new incident.(Not relecting instantly)

 So how do I update the value if it is assigned to one incident, and if I open another incident, only to show values whose active status is "true".

Below is the Script library:

function InstallTeamPriority(priority,prioritySaved)
{
var installFile=new SCFile("installpriority");
var query="number=\""+priority+"\"";
var rc=installFile.doSelect(query);
if(rc==RC_SUCCESS)
{
installFile.activestatus="false";
var rc1=installFile.doUpdate();
if(prioritySaved!=priority)
{
var installFile1=new SCFile("installpriority");
var query1="number=\""+prioritySaved+"\"";
var rc2=installFile1.doSelect(query1);
if(rc2==RC_SUCCESS)
{
installFile1.activestatus="true";
var rc3=installFile1.doUpdate();
}
}
}
}

function InstallTeamPriorityClose(priority)
{
var installFile=new SCFile("installpriority");
var query="number=\""+priority+"\"";
var rc=installFile.doSelect(query);
if(rc==RC_SUCCESS)
{
installFile.activestatus="true";
var rc1=installFile.doUpdate();
}
}

In forms im.open.incident , im.close.incident,im.update.incident , For 'install team priority' field i have given below condition in value list condition

select("number","installpriority","activestatus",true)

 I have also tried by displaying values in drop down list using global list.

GL.PNG

But values in drop down is not reflecting instantly acconding to values in table.

Please suggest a solution for this.

Thanks & Regards,

Jithisha 

 

 

0 Likes
7 Replies
Highlighted
Super Contributor.
Super Contributor.

Hello,

Can you please confirm the SM version that you have? it seems that this field is like a customization that need to troubleshooting.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Hi Robcord,

 

SM version is 9.4

 

Thanks & Regards,

Jithisha

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Hello.

About your  "Table screen shot"

This is screenshot from MSSQL, can you check fileds name for this table in SM (they can be not same)?

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Hi Alarms,

 

Fields name in SM are same.

Screen shot of combo box(Install Team Priority)

combobox.PNG

 

Please suggest solution for this.

 

Thanks & Regards,

Jithisha

 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

I mean names of fields in installpriority table. Can you show dbdict for this table ?

And about your Glabal list (but i think that select should work) - can you check value for your GL (in RAD debugger: d $G.InstallTeamPriorityList and d $G.InstallTeamPriorityDisplay)

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Hi Alarms,

Please find the screenshot of dbdict.

dbdict.PNG
backend changes are not reflecting instantly,
For example. if I select '3' from drop down list and save IM. In table activestatus filed for 3 gets set to false.
Next when I am going to create a new IM, in drop down list this '3' should not be displayed. But for me its displaying.
Kindly suggest a solution for this.
Thanks & Regards,
Jithisha

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

1) In your dbdict i see "_" symbol for each field name (except descriptor) - _id, _number, _activestatus,...

is that right ?

2) I think you need use triggers for IM update, where you can set false in activestatus filed of installpriority table.

And use select in FD for IM update.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.