This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Create Dynamic Role for ITShop from Script

Hi all,

I'm trying to create a dynamic role fro the visbility of an ITShop from script triggered when a certain event is called but the script return me the following error:

"Dynamic roles: Write permission denied for value "Dynamic role"

 

This is my script:

 

' create or find dynamic group
Dim dynamicGroup As ISingleDbObject
Dim uid_dynamicGroup As String = Connection.GetSingleProperty("dynamicGroup","uid_dynamicGroup","ObjectKeyBaseTree='<Key><T>ITShopOrg</T><P>"+uid_customers+"</P></Key>'")
dynamicGroup = Connection.CreateSingle("dynamicGroup")
If (uid_dynamicGroup.Equals("")) Then

'msgbox ("uid_customers " + uid_customers)
dynamicGroup.PutValue("ObjectKeyBaseTree","<Key><T>ITShopOrg</T><P>"+uid_customers+"</P></Key>")
dynamicGroup.PutValue("uid_dialogschedule",connection.GetSingleProperty("dialogschedule","uid_dialogschedule","name = 'Dynamic roles check'"))
dynamicGroup.PutValue("uid_dialogtableobjectclass",connection.GetSingleProperty("dialogtable","uid_dialogtable","tablename = 'Person'"))
dynamicGroup.PutValue("whereclause","isnull(IsInActive, 0) = 0") 'only active employes
'dynamicGroup.PutValue("whereclause","1=2")
dynamicGroup.Save
dynamicGroup.Load
uid_dynamicGroup = dynamicGroup.getValue("uid_dynamicGroup")
...
dynamicGroup.PutValue("uid_dynamicGroup",uid_dynamicGroup)
dynamicGroup.Load

dynamicGroup.PutValue("whereclause","isnull(IsInActive, 0) = 0") 'only active employes
dynamicGroup.Save
dynamicGroup.Load

There is any way to accomplish that?

This script running on 7.0 didn't return any error now on 7.1 yes.

 

Thanks Michele

Parents
  • Something strange is happen, is my code:

    ' create or find dynamic group
    Dim dynamicGroup As ISingleDbObject
    Dim uid_dynamicGroup As String = Connection.GetSingleProperty("dynamicGroup","uid_dynamicGroup","ObjectKeyBaseTree='<Key><T>ITShopOrg</T><P>"+uid_customers+"</P></Key>'")
    dynamicGroup = Connection.CreateSingle("dynamicGroup")
    If (uid_dynamicGroup.Equals("")) Then

       dynamicGroup.PutValue("DysplayName","pippo") '<----- this the line I added

       dynamicGroup.PutValue("ObjectKeyBaseTree","<Key><T>ITShopOrg</T><P>"+uid_customers+"</P></Key>")
       dynamicGroup.PutValue("uid_dialogschedule",connection.GetSingleProperty("dialogschedule","uid_dialogschedule","name = 'Dynamic roles check'"))
       dynamicGroup.PutValue("uid_dialogtableobjectclass",connection.GetSingleProperty("dialogtable","uid_dialogtable","tablename = 'Person'"))
       dynamicGroup.PutValue("whereclause","isnull(IsInActive, 0) = 0") 'only active employes
       dynamicGroup.Save
       dynamicGroup.Load
       uid_dynamicGroup = dynamicGroup.getValue("uid_dynamicGroup")
    End If
    dynamicGroup.PutValue("uid_dynamicGroup",uid_dynamicGroup)
    dynamicGroup.Load
    dynamicGroup.PutValue("whereclause","isnull(IsInActive, 0) = 0") 'only active employes
    dynamicGroup.Save

     

    Now if I put the line dynamicGroup.PutValue("DysplayName","pippo") it returns me the error:

     Column DysplayName was not found in object of type DynamicGroup

    But there is that column in table DynamicGroup

    If I dont' put it returns me the error:

    Dynamic roles: Write permission denied for value "Dynamic role".

     

    I don't have customization on the column nor on the table

    I don't know what is happen

Reply
  • Something strange is happen, is my code:

    ' create or find dynamic group
    Dim dynamicGroup As ISingleDbObject
    Dim uid_dynamicGroup As String = Connection.GetSingleProperty("dynamicGroup","uid_dynamicGroup","ObjectKeyBaseTree='<Key><T>ITShopOrg</T><P>"+uid_customers+"</P></Key>'")
    dynamicGroup = Connection.CreateSingle("dynamicGroup")
    If (uid_dynamicGroup.Equals("")) Then

       dynamicGroup.PutValue("DysplayName","pippo") '<----- this the line I added

       dynamicGroup.PutValue("ObjectKeyBaseTree","<Key><T>ITShopOrg</T><P>"+uid_customers+"</P></Key>")
       dynamicGroup.PutValue("uid_dialogschedule",connection.GetSingleProperty("dialogschedule","uid_dialogschedule","name = 'Dynamic roles check'"))
       dynamicGroup.PutValue("uid_dialogtableobjectclass",connection.GetSingleProperty("dialogtable","uid_dialogtable","tablename = 'Person'"))
       dynamicGroup.PutValue("whereclause","isnull(IsInActive, 0) = 0") 'only active employes
       dynamicGroup.Save
       dynamicGroup.Load
       uid_dynamicGroup = dynamicGroup.getValue("uid_dynamicGroup")
    End If
    dynamicGroup.PutValue("uid_dynamicGroup",uid_dynamicGroup)
    dynamicGroup.Load
    dynamicGroup.PutValue("whereclause","isnull(IsInActive, 0) = 0") 'only active employes
    dynamicGroup.Save

     

    Now if I put the line dynamicGroup.PutValue("DysplayName","pippo") it returns me the error:

     Column DysplayName was not found in object of type DynamicGroup

    But there is that column in table DynamicGroup

    If I dont' put it returns me the error:

    Dynamic roles: Write permission denied for value "Dynamic role".

     

    I don't have customization on the column nor on the table

    I don't know what is happen

Children
No Data