The CreatorCon Call for Content is officially open! Get started here.

canWrite() function for parent records

Leonel Sandroni
Tera Guru

Hi there,

 

I'm trying to restric ACLs permissions for Demand RIDACs items according to demand record permissions. I need to use the canWrite() function and it should look the parent demand record. I have builded a script but it doesn't work

 

var answer=false;

    // Check if current user can edit parent

    if (parent.canWrite()) 
      
       {
        answer=true;
      }

 

 

Do you know what is wrong?

Thanks

1 ACCEPTED SOLUTION

Leonel Sandroni
Tera Guru

Ok, I have found the solution. First you need to refert to the parent record with getRefRecord() and then check permissions with canWrite so:

var parent= current.parent.getRefRecord();
      answer = parent.canWrite();

 

it should work

View solution in original post

9 REPLIES 9

Sonam Tiwari
Tera Guru

@Leonel Sandroni ,

What if you try with current.parent.canWrite()?


Give permissions to write demand task and ridacs. If any user has write permissions for demand records then he should be able to write demand task. The script in the write acl for demand task should check write permissions on parent demand record.

Try 

var answer=false;

    // Check if current user can edit parent

    if (current.parent.canWrite()) 
      
       {
        answer=true;
      }

hello @Sandeep Rajput

 

I have tried with that script but unfortunately it doesn't work