Add modules as favorites upon assigning the role

mokshasree
Giga Contributor

Hello Everyone!

 

I'm trying to add some modules say Project related to user favorites upon assigning it_project_manager role but with no luck. Somebody please point me in right direction to achieve this.

 

Thanks in Advance!

2 ACCEPTED SOLUTIONS

AnveshKumar M
Tera Sage
Tera Sage

Hi @mokshasree 

You can try creating an after insert business rule on the sys_user_has_role table with condition like Role :: IS :: it_project_manager

 

And in the script section do your modules insertions to the sys_ui_bookmark table with fields

user, pinned , title, URL, color, order values.

 

 

The order field value has to be dynamically generated based on users existing favourites, to do this in your script query the sys_ui_bookmark table orderByDesc on order field and get the highest order value the user has, if there are no recorda the order would be 0.

 

Please mark my answer helpful and accept as solution if it helped you 👍

Thanks,
Anvesh

View solution in original post

@mokshasree Yes, it is possible. you need to add the records to sys_ui_bookmark_group table first and while inserting the favorites you should set group field with the sys_id of the group record you inserted.

Thanks,
Anvesh

View solution in original post

6 REPLIES 6

AnveshKumar M
Tera Sage
Tera Sage

Hi @mokshasree 

You can try creating an after insert business rule on the sys_user_has_role table with condition like Role :: IS :: it_project_manager

 

And in the script section do your modules insertions to the sys_ui_bookmark table with fields

user, pinned , title, URL, color, order values.

 

 

The order field value has to be dynamically generated based on users existing favourites, to do this in your script query the sys_ui_bookmark table orderByDesc on order field and get the highest order value the user has, if there are no recorda the order would be 0.

 

Please mark my answer helpful and accept as solution if it helped you 👍

Thanks,
Anvesh

@AnveshKumar M Thanks for the solution. Can we also add groups?

@mokshasree Yes, it is possible. you need to add the records to sys_ui_bookmark_group table first and while inserting the favorites you should set group field with the sys_id of the group record you inserted.

Thanks,
Anvesh

Thanks Anvesh, it worked.