Re: Change category list (453 Views)
Reply
Honored Contributor
Vadim Gorda
Posts: 5,822
Registered: ‎11-10-2008
Message 1 of 6 (489 Views)

Change category list

Hello,

This topic was raised a lot of times but still I can not find a proper solution.

 

For example, when you click on Open change from menu the list of the available categories are displayed on the screen (from menu is called RAD cmc.open.from.menu). The same list is displayed if you do from some record (for example Change) Related>Change>Open.

Which application is building the list of the allowed categories?

 

Main goal is to limit the list of offered categories for exact situation. For example if i click on some button the list should contain only 2 exact category and not all existant in the system.

Esteemed Contributor
Kelalek2
Posts: 191
Registered: ‎08-05-2011
Message 2 of 6 (477 Views)

Re: Change category list

[ Edited ]

I don't know if this approach is suitable to your requirements, but check this thread:

 

http://h30499.www3.hp.com/t5/HP-Service-Manager-Service/I-need-to-change-Classical-way-to-open-a-Cha...

 

If you decide to use the method is suggest, I'd recommend hiding the original display options which opens a new change and making own change open display actions instead.

 

By using wizard it's easier to make own queries to change category file without tampering the OOB way to do things.

Honored Contributor
Piku
Posts: 4,065
Registered: ‎06-17-2010
Message 3 of 6 (476 Views)

Re: Change category list

Hi Vadim,

As you are aware that menu link is calling "call.open.process" application and here you can see it is calling process "call.open.process" and passing the environment variable $G.cm3r.environment by variable "record" and same is passing to cm.open process in RAD "cm.open". So feels that here the change environment record(in variable record) defines the accessible category.

So you might try to alter the record variable or $G.cm3r.environment temporarily.


hth,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
Vadim Gorda
Posts: 5,822
Registered: ‎11-10-2008
Message 4 of 6 (467 Views)

Re: Change category list

Thank you for answers!

just to sort it out. I have written scripts which add new change but this is a bit different situation. It must be close to OOB.

 

@Kelakek - I was thinking of wizards but there are bunch of troubles with taht approach. Still i need similiar to normal change opening form with the whole number of fields  (wizard has much smaller window size). Then i need to pass the fields from the parent record (the one from which the button is clicked), like it is done via screaltion. So at the moment wizards is the least option which i want to take.

 

@Piku - I was trying to use us.screlate.options RAD but it is working fine for change to change creation. The current goal is to initiate change with limited category offering from device. Was trying to play with allowed.cats in $G.cm3r.environment, but it is not always working.

Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 5 of 6 (453 Views)

Re: Change category list

[ Edited ]

I think editing the values in the $G.cm3r.environment variable is really the best way to go here that gives you the most power for the simplest code.

 

If you open a change from the menu or from Related>Changes>Open, in either case, the system ends up calling the cm.open Process record.  In the Initial Expressions or the Javascript, you can write out code that sets the categories based on whatever rules you need.  Then, in the Post Expressions or Post Javascript, reset that variable to its default for that user.

 

What part of this solution was giving you trouble?  I'm pretty sure this is the best way to go to get what you're trying to get...At least until HP comes up with something new.

Honored Contributor
Vadim Gorda
Posts: 5,822
Registered: ‎11-10-2008
Message 6 of 6 (440 Views)

Re: Change category list

Hello Jacob and thank you for reply.

In fact everything ended with total removal of standard mechanism of opening change (mainly they are added now based on scripts) and only for that one spot which i meant in this topic we limited the categoryes by setting false in the category definition.

 

Regarding category filtering based on environment - we were trying to do similiar functionality based on it but, setting specific categories for some exact spot was not working from the first run of the script (it was showing  all categories regardless of JS which was setting only exact once ) and only on the second calling the list was limited. Probably the person who wrote the script made it not appropriate spot (maybe post JS or something) but it defently was not 100% working mechanism.

Anyway in future i will try to do it again but at the moment simple limitation in category difinition solved the problem.

 

Thanks for answers everyone.

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.