Ess page Customization (545 Views)
Reply
Trusted Contributor
Posts: 388
Registered: ‎06-17-2013
Message 1 of 10 (545 Views)
Accepted Solution

Ess page Customization

[ Edited ]

Hi Experts,

 

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.

 

Untitled.png

 

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?

 

Please help.

 

Thanks,

Sanjeev

Honored Contributor
Posts: 5,899
Registered: ‎11-10-2008
Message 2 of 10 (505 Views)

Re: Ess page Customization

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+"*\""

 

 

Trusted Contributor
Posts: 388
Registered: ‎06-17-2013
Message 3 of 10 (496 Views)

Re: Ess page Customization

[ Edited ]

Hi Vadim,

 

Thanks for the response as always.

The affected Service field has an attribute "affected.item"

=================================================================================

link>incidents>affected.item

 

Untitled.png

 

===================================================================================

 

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

 

Please help.

 

Thanks,

Sanjeev

Honored Contributor
Posts: 5,899
Registered: ‎11-10-2008
Message 4 of 10 (489 Views)

Re: Ess page Customization

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.

 

 

 

Trusted Contributor
Posts: 388
Registered: ‎06-17-2013
Message 5 of 10 (479 Views)

Re: Ess page Customization

Hi Vadim,

 

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.

 

Adding,

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.

 

Untitled.png

 

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.

 

Thanks,

Sanjeev

Honored Contributor
Posts: 5,899
Registered: ‎11-10-2008
Message 6 of 10 (468 Views)

Re: Ess page Customization

Hello,

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.

Trusted Contributor
Posts: 388
Registered: ‎06-17-2013
Message 7 of 10 (458 Views)

Re: Ess page Customization

[ Edited ]

Hi Vadim,

 

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+"*\?

 

Untitled.png

 

Thanks and Best regards,

Sanjeev

Honored Contributor
Posts: 5,899
Registered: ‎11-10-2008
Message 8 of 10 (447 Views)

Re: Ess page Customization

Hello,

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).

Trusted Contributor
Posts: 388
Registered: ‎06-17-2013
Message 9 of 10 (403 Views)

Re: Ess page Customization

Hi,

 

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?

 

Please help.

 

Thanks,

Sanjeev

Honored Contributor
Posts: 5,899
Registered: ‎11-10-2008
Message 10 of 10 (392 Views)

Re: Ess page Customization

Hello,

add to your query in the link

 

if (not null($G.contact.location)) then ..... else ($query=false)

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.