Solved

How do you generate a commvault entity for a dropdown box?

  • 31 August 2022
  • 7 replies
  • 90 views

Userlevel 5
Badge +16

I would assume that it is a just a list of commvault.msgs.CvEntities.ClientGroupEntity

This object appears to just consist of a clientGroupName string and a clientGroupId integer.

 

icon

Best answer by RMcG 1 September 2022, 05:39

View original

7 replies

Userlevel 7
Badge +23

Adding @RMcG - I think they may know 😀

Userlevel 3
Badge +6

Hi @christopherlecky 

which commvault entity were you looking to add in a drop down?

Userlevel 3
Badge +6

Here’s a couple of examples…

 

ClientEntity
ClientGroupEntity

Is that what you’re after?

Userlevel 3
Badge +6

The entity selection in field type is mostly used to automatically start showing the relevant entities in a user form without having to write a lot of code for it. So, when you mark an input field as clientgroupentity, the user automatically gets a list of client groups. If you are doing some backend coding without taking that as an input then I dont see much value in using the entity classes.

 

Userlevel 5
Badge +16

Here’s a couple of examples…

 

ClientEntity
ClientGroupEntity

Is that what you’re after?

This looks like the first half of what I want.

 

I will explain what I am trying to do… 

Sometimes I need to present a dropdown of filtered entities. For example; if I wanted to present a dropdown of clients with the SQL agent active there is no way to do it using the standard entities.

 

The goal here then is to run a query and then transform the results into a list of entities, which is what I assume is what I could use for the dropdown.

So my next question is could I do something like this : Defining a list of client entitites and then populate it to with the CE objects you 

def ce=[]

def assert cs instanceof list

assert cs.size() == clientcount

 

Just imagine I am reading through  rows here and populating the entity values then adding them to the list.

 

 

workflow.setVariable(“ce”,ce)

Then in the dropdown field the field and values would be

java:{workflow.getVariable(“ce”)}:java

 

Does that make sense?

 

Thanks.

Chris.

 

 

 

 

Userlevel 5
Badge +16

The entity selection in field type is mostly used to automatically start showing the relevant entities in a user form without having to write a lot of code for it. So, when you mark an input field as clientgroupentity, the user automatically gets a list of client groups. If you are doing some backend coding without taking that as an input then I dont see much value in using the entity classes.

 

The value is that you can use it throughout the workflow without having to do things like interpreting objects at every turn. 

I have been using custom objects but that forces you to code in situations where it isn’t necessary.

For example for a client entity once defined I can use the visual parts of the workflow to reference it. Basically a hybrid approach for people like me who can read code pretty easily but it not a coder by trade.

Though I do see your point. 

 

 

Userlevel 3
Badge +6

For now you can use the labels and values field in customize input.

 

 

Reply