![]() | ![]() |
|
09-16-2011 05:44 AM
Hi,
Could any one suggest me how to assign a folder to user dynamically depending on the value fetched from database..
Thanks in advance
Sundeep
Solved! Go to Solution.
09-16-2011 08:56 AM
You need to use a dynamic role. Define a new role and set the formula to whatever you need - so if you need a database value it is likely to be a select statement (Metastorm formula of course). Just beware that your formula needs to return a List of Metastorm user names.
Hope this helps.
09-16-2011 01:37 PM
What Paul stated but you will need to enable Dynamic role. I believe by default Metastorm installs with dynamic role disable.
09-19-2011 02:39 AM
Hi Paul,
As per your suggestion i have created Dynamic Role using the below formula.
SelectSql(
new RoleManagement_DBConnection(),"SELECT Manager FROM (select Manager , ROW_NUMBER()OVER(ORDER BY PortfolioManager DESC) AS RowNumber from Resources_Data where Resource_Status='Yes' group by Manager ) as t1 where t1.RowNumber=2;")
In the Formula Tab of the Role creation.
Above query fetches the one record which is name of the Manager. For Example consider 'sundeep' is fetched from that record.
I have already created a user with name 'sundeep'. Also for your information i am using flag from another process to create the task.
I was expecting that task which ever was created using flag will be visible to only sundeep.
Status: i am able to see 2 outputs after implementing this
1. I am able to see the case from all users
2. Though the case was created I am not able to see the case with any user.
could you please suggest where i am going wrong and also could you please tell me what should i do to enable dynamic roles in metastorm.
09-19-2011 02:40 AM
09-19-2011 03:54 AM
You must return a list from your SQL statement so you will need to use .List
Remember that ToDo and Watch list are calculated when a folder hits a stage so if your folder was already at a stage creating new or modifies roles will not add entries to these lists.
09-19-2011 03:55 AM
You do not need to enable dynamic roles.
09-19-2011 07:48 AM - last edited on 09-19-2011 07:55 AM
Hi Paul,
Thanks for you quick reply.
Could you please provide more information on the details you have provided..
I did the following after seein your post :
It worked when i used ListItems function in the roles formula ,which is provided out of box by Metastorm and entered the user name in quotes.
But when i entered the sql statement to get the value dynamically from db using the select statement it is not taking that value.
As per my knowledge , the select statement will return the data in the form of list, if not could you please let me know how can i get the data from db in the LIST form.
appreciate if you can provide an example for getting the data in list form using any simple select query.
Added the screen shots of both the scenarios discussed above.
Thanks in Advance.
09-19-2011 07:54 AM
try this.... SelectSql(new myConnection(),mySQLStatement).List
09-19-2011 07:59 AM
Thanks Paul,,
It worked.
![]() |
![]() |
![]() |
|
|
![]() |
![]() |
![]() |
















