Tuesday, 6 May 2014

Code to find whether the role is assigned to User

How to find whether the role is assigned to User or not :


Class\SalesTableListPageInteraction\setButtonSell() method.

               while select User, SecurityRole from t1 
        join company from t2 where t2.id == t1.User
        join Name from t3 where t1.SecurityRole == t3.RecId &&
           t1.User == curUserId() &&         
           t2.company == curext()
          
    {
        if(t3.name == "Sales manager" && salestable.DocumentStatus == DocumentStatus::Confirmation)
            allowUpdate = false;
        else
            allowUpdate = true;
       // info(strFmt("%1,%2,%3",t1.User,t1.SecurityRole, t3.Name));
    }
   
    this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, EditButton),        allowUpdate);


No comments:

Post a Comment