Hiding a U-action on a related list when no rows are found

Chris P_
Tera Expert

Hi, I pretty much explained it in the title, but I've got this UI-button on a related list called 'Enroll for Training', which lets the user enroll the current employee for a training in that list.

If no training is present in that list, I would like to hide that button.

I'm also already using RP.isRelatedList() as a condition, because I don't wat to see this UI action when I'm in my Training table.

Anyone know how to see (preferably in the UI-action condition) if the (related) has any rows?

Cheers Chris

1 ACCEPTED SOLUTION

Then you have to code for it, is suggest you write a new Script include and define a function in there that identifies if there are any records present or not, and return true/false based on that.

 

in the condition you can add new SCRIPTINCLUDENAME().FUNCTIONNAME()

-Anurag

View solution in original post

4 REPLIES 4

Anurag Tripathi
Mega Patron
Mega Patron

Hi Chris,

Quickest solution will be to navigate to list control for the related list and check 'omit if Empty' from there.

PS, in this case the related list itself will not show up if there are no records.

-Anurag

Chris P_
Tera Expert

Yeah I also tried that solution, sorry for not mentioning it, but since the related list itself then disappears I didn't like the solution...

And to I thought, if that checkbutton can see if the list is empty, why can't I?
But I couldn't find the code for it...

Then you have to code for it, is suggest you write a new Script include and define a function in there that identifies if there are any records present or not, and return true/false based on that.

 

in the condition you can add new SCRIPTINCLUDENAME().FUNCTIONNAME()

-Anurag

Chris P_
Tera Expert

That should work thanks for the tip!