11-14-2013 12:51 AM - edited 11-14-2013 12:54 AM
I have customized the ess.SD.open page. Added a location field which populates the contacts location.
Now, I want the location to be populated in Affected Services field without changing the input attribute "affected.item". Its like I want to pouplate the field affected services with location value at runtime.
And the reason why I want to do this is because the affected services are named after the contact's location.
For e.g as shown in the image above, Airport user from "Laketown" location can only view services named after contact location, i.e. Laketown_Desktop, Laketown_Computer, Laketown_Switch and so on after they click on the fill button.
So how do I populate the location value in affected services field at run time without changing the input "affected.item" attribute?
Solved! Go to Solution.
11-14-2013 03:16 AM
So you want to get the values in the affected.service field after clicking on the fill button only with the expansion of the location which you have on the form.
Modify the link which is looking at the affected.service field and add query something like
$query="affected.service like \"*"+location in $File+"*\""
11-14-2013 04:20 AM - edited 11-14-2013 04:22 AM
Thanks for the response as always.
The affected Service field has an attribute "affected.item"
The query defined for the affected.item fetches the item from device type cctns.
If I modify the query as $query="affected.iem like \"*"+location in $File+"*\"" , then no item will be fetched.
The items defined under device type "cctns" is the expansion of location.
And I didn't find any attrbute named as affected.service in Link:incidents
11-14-2013 04:40 AM
of course you need additional tailoring to put this in the existant mechanism. At the end of the Query add expression
if (not null(location in $File)) then $query+=(" and logical.name like \"*"+location in $File+"*\"")
This will do following, if the location field will contain any data it will be added to the link query.
11-14-2013 05:58 AM
The location field is customized in the ess.SD.open page. The attribute for the location is the variable $G.contact.location which contains the location value.
if (not null(location in $File)) then $query+=(" and logical.name like \"*"+location in $File+"*\"") didn't work.
So I updated it with
if (not null($G.contact.location in $File)) then $query+=(" and logical.name like \"*"+$G.contact.location in $File+"*\"") but no luck.
Please have a look when you have time. Please let me know if need any information regarding the customization done in ess.SD.open page.
11-14-2013 12:18 PM
I thought you have made assignment to some field in incidents table from this variable.
You were almost correct with variable
if (not null($G.contact.location)) then $query+=(" and logical.name like \"*"+$G.contact.location+"*\"")
Remove $File in case of the variable and try it. I have not ised global variables in links (at least in last time) but it must work.
For future - $file, $File. .. and rest file records are used only for field which are in tables. In case of variable, global or local, you are using directly it's name without addition of any file.
11-14-2013 10:55 PM - edited 11-14-2013 11:12 PM
Thanks a lot. It worked. You saved my day.
One more thing I came accross,
the query is also pulling up those affected services which have location somewhere in between. And that I dont want. Shall I remove the "*" from the query \"*"+$G.contact.location+"*\?
Thanks and Best regards,
11-15-2013 01:25 AM
If you remove * (like search) and replace it with # in the beginign of the field, ti will populate only services which are starting with that location name.
When I was posting the logic with like statement, I thought that location name could have been in the end like E-mail_Asia. If you always have name starting with location then you can replace it with # (starts with statement).
12-04-2013 04:42 AM
What query shall I put such that for the users's whith no location cannot view any Affected Services?
The reason I am asking because there are few users in LDAP which don't have a location. Now these users can view all the affected services which I don't want. So what query shall I put?
12-04-2013 11:17 PM