UI Action on List

kristenankeny
Tera Guru

I have a UI Action set up as a list choice with a condition current.parent==''.

First issue:

When I see the UI action in the list choice, I can see that it doesn't apply to all of the records, but if I choose to continue, it will run against that selected record. I've tried adding an if statement in the script to prevent it running on selections where the condition doesn't match, but it now is failing for all attempts to use the UI Action and shows my error message instead. This is the UI Action setup:

find_real_file.png

Secondary issue:

The error message is showing up for as many of the records I selected and I really only need a single error message. How do I change the script to do this?

Thanks!

6 REPLIES 6

bernyalvarado
Mega Sage

Hi Kristen,



It appears that your UI action is a client one. You may want to make it a server one if you want to leverage the current object and be able to apply it to multiple records in the list view.



Thanks,


Berny


bernyalvarado
Mega Sage

I'm also wondering why you're creating a UI action for this. Is there a decision that a person needs to do to associate the parent record to the parent_incident field? Would it satisfy your requirement if you have a business rule that updates the parent_incident whenever the parent field changes?



Thanks,


Berny


bernyalvarado
Mega Sage

On regards your last question, UI actions are applied on the context of one record. If you want to apply a logic to multiple records (incidents) at the same time then other mechanism sound more appropriate such as a background script or a scheduled job.



Thanks,


Berny


bernyalvarado
Mega Sage

Hope this helps



Thanks,


Berny