- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2015 03:44 AM
Hi,
I have been thinking how to let users with project_user role to have write acl on the table pm_project_task ONLY if he is the project_manager (field) of the parent project (pm_project).
I grant write to the role with a condition where (dot walking) .u_ref_proj.project_manager is (dynamic) me, but then all project tasks fields become Read Only.
u_ref_proj is a project task field which references to project table.
I have been trying to add the following script (suggested by other in the community) instead of the control but nothing changes:
It is weird because I applied the same script for omitting the New button (thanks to Anurag) from the list and it worked (changing the true/false for the answer)...
var utente=gs.getUserID();
if (parent.project_manager==utente) //since we have a relationship/related list between the two tables
answer=true;
else
answer=false;
I would appreciate any comment!
Thanks,
Skender
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2015 01:00 AM
just write the code that when a new task is added , the project number is filled in u_ref_proj.
And on the projet form use the "-> parent" related list.
This will fix all your troubles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2015 01:06 AM
a before business rule on project task
if(current.parent!='')
{
current.u_ref_proj=current.parent;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2015 01:16 AM
It is not working. I see the field empty and it is not filling the current project... When i click new project task, I should write manually the project.
What could be missing? WHEN and ACTION are empty. I just added the in the advance tab the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2015 02:46 AM
When - Before
Insert/update both
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2015 06:07 AM
It works.
The BR is right.
But what can I do for the already created project tasks... I mean, before this rule. It works only in insert || update record, right?
Thanks a lot,
Skender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2015 06:13 AM
I think the only way is to update them all, one by one...