Custom Columns: How to get values from filters?
Hello everybody:
normally, when I create a custom column, I always find a method that suits my needs. But I am just trying to use a method where some parameters need to be passed to it. In this case, In the Vendor selection view, that shows the price profiles, I would like to get the Rates belonging yo it.
The thing is that the method that I found and could be useful for that is:
com.radzisz.xtrf.model.partner.PriceProfile |
As you can see, this method accepts the Source and target language, etc.. I have the feeling that those are members that I can only get from the filters where the custom column is programmed. But that's the thing, I don't know how to get their values.
I normally program the custom columns in Groovy and in this case, the Class Name is: Price Profile.
Thanks in advance for reading and answering.
My best regards.
Customer support service by UserEcho
Hi, can you explain what you are trying to do? Do you simply want to see the rates for each price profile when selecting vendors? Or are you trying to see ALL the rates for each price profile in a view of vendors?
Thanks for your answer Alexandros.
What I am trying to achieve, is to get a column that will show all the specializations for the chosen language combination.
So if a source and a target is set on the filters, the column will show all the specializations for that language combination inside the price profile.
Thanks.
My best regards.
The filter will filter on Provider > Source language and Provider > Target language.
Therefore, you have to use this value from the provider.
As the provider can have multiple language combinations, you will have to loop through them.
Try something like this, you can probably fill in the rest.
Thanks a lot for your answer, Dennis.
But what if I want the source and target language chosen in the filters?
I might be searching for all the specializations, for a specific vendor, for a specific language combination (all these values should be in filters).
Thanks a lot. My best regards.
I don't think you can get to the values of the specific filters. The custom column will evaluate on the entity itself. To my knowledge it is not aware on where it is used and therefore it won't know the specific filter value.
Thanks Dennis.
Really appreciate your answers. It totally makes sense.
My best regards.
In the end, what I have decided to do is to get the price profile's provider and go through every single rate getting the specializations.
The array containing all the specializations will be purged deleting all the duplicates.
This is the code:
def result = "-"
def arraySpecializations = new ArrayList()
def rates = processedEntity.provider.rates
for (def rate : rates){
def specializations = rate.languageSpecializations
for (def specialization:specializations)
arraySpecializations.add(specialization.displayName)
}
arraySpecializations = arraySpecializations.unique()
if(arraySpecializations.size() != 0) {
result = String.join(", ", arraySpecializations)
}
return result
}