Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

How to display selected category in a form for each different user

I have a form and on this form, there is a dialog list field called meetingtype which gets the value from another view. The values are Manager,Sales, Supervisor,Employee,Other.

I have created roles for this database - Manager, Sales, Supervisor, Employee, Other.
How do I code my meetingtype field or my form such that when user A access this db, user A roles are Employee and Other so when user A create this form, when he click on the meetingtype field, it will show Employee and Other and no other values.
When another user B Supervisor access this db, user B roles are Supervisor,Employee and Other.So when user B creates this form, when he click on the meetingtype field, it will show Supervisor,Employee and Other.

Pls help.
Thanks.
0
kopibean
Asked:
kopibean
  • 7
  • 6
  • 2
1 Solution
 
madheeswarCommented:
u need to use:
@If(@Ismember(@Userroles;"[Manager]");"All":"A":"B":"C";@Ismember(@Userroles;"[Sales]");"A":"B":"C";"C")

Like that u need to code in your field. this formula cjange according to your needs(roles and choices)

Select the field as DialogList
and in second tab: useFormula for choises.

and use the code.
0
 
kopibeanAuthor Commented:
madheeswar,
I tried your code but it seems to be not working.
When user A with [Manager] role, he should be able to see Supervisor,Employee,Other in the field meetingtype or
When user B with [Sales] role, he should be able to see only Employee, Other in the field meetingtype.
But it shows Other in the field meetingtype when both user create the form.
Is there anything wrong??
0
 
madheeswarCommented:
use this:
@If(@Ismember(@Userroles;"[Manager]");"Supervisor":"Employee":"Other";@Ismember(@Userroles;"[Sales]");"Employee":"Other";"Nothing")

In your comment above u stated that it it is manager/Sales it should display Others also as choice.

If you don't want others, then remove it from the formula.
Even we can do the above formula using @Subset. But the code provided will be easy to understand for newbie's.

What is the formula you are using? If the above doesn't works, then paste your code here.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kopibeanAuthor Commented:
madheeswar,
i paste your code into the editable dialog list field and when user A is [Manager], it display nothing.
when another user B is [Sales], it also disaply nothing.

If user is [Manager], it will show Manager,Sales, Supervisor,Employee,Other
If user is [Sales], it will show Sales,Employee,Other
If user is [Employee], it will show Employee, Other

But these values(Manager,Sales, Supervisor,Employee,Other ) is get from another view where user can key in more values.
THus is there way to retrieve value from the view rather than hard code in the field?

Thanks!
0
 
madheeswarCommented:
>>But these values(Manager,Sales, Supervisor,Employee,Other ) is get from another view where user can key in more values.
THus is there way to retrieve value from the view rather than hard code in the field?
<<<

this you need to tell FIRST.

Create a form and have three fields.(name it choiceform)
Type of Category: type_x (Editable,text) 'here users will enter what type of category they want to show on the form.i.e., newly created

Who need to see: view_x (Keywords,Multivalue. hardcode choices: All the roles with Square Braces) Enter the roles

readers field: readers_x  (Computed, text, multivalue. separator semicolon) and default value is: view_x

once u select roles in view_x, this value will be appended to readers field and the users who are having this role, can see the choices.

And create a view(name: choiceview). Selection formula:
Select Form="choiceform"

and in first column:
value is type_x


And on the original form for the meetintype field use this formula:

res:=@DbColumn("":"Nocache";"";"choiceview";1);
@if(@Iserror(res);"Error";res)


the above should work perfectly.
0
 
kopibeanAuthor Commented:
madheeswar,

the field view_x should be a keyword field which is a dialog field where I key in all the roles?

When user A with role [Sales], he should only see Sales FC Meeting and Other but instead it display Manager's meeting,Sales FC Meeting and Other. Manager's meeting should not be displayed for him.

Is there anything that I miss?
Pls help.
THanks.
0
 
kopibeanAuthor Commented:
Anyone can help me to solve this problem?
Pls advise.
THank you.
0
 
madheeswarCommented:
YEs. view_x holds all type of roles.

This will work. Did u tried?

0
 
kopibeanAuthor Commented:
madheeswar,

I tried your solution. But it fails.
When user A with role [Sales], he should only see Sales FC Meeting and Other but instead it display Manager's meeting,Sales FC Meeting and Other. Manager's meeting should not be displayed for him.

Please kindly advise.
Thank you.
0
 
madheeswarCommented:
So, u created documents as I said and selected roles.

What readers_x is displaying values?

it should display values of roles.

And open the view(choiceview) which the above documents are stored. And enter as manager role. It should display only the documents which ur listed in the readersw_x field. Else ur not succeded. U have done something wrong in readers field.
0
 
kopibeanAuthor Commented:
readers_x is displaying [Manager] when the meeting type is Manager's Meeting in choiceform.
If the meeting type entered is Sales FC Meeting,values of roles Sales and Manager are displayed

but on the meetingform, when user is [Sales] role, the meetintype field it display is Sales FC Meeting, Manager's Meeting which Manager's Meeting should not be displayed as user is [Sales] role.

Any idea?
Thanks.
0
 
madheeswarCommented:
so, u mean person who is having role [Sales], is able to view Managers meeting ?

As I said u before, with the same role, r u able to view the document in view choiceview?
U should not view the document if u have Sales role enabled. if it is displaying, then readers_x is not a readers field at all.

U should select readers_x as readers type and computed. default value as admin (this is role for generic use)
Currnetly I don't have PC installed with Notes. Once I get it, I will send u a sample template.

In the meantime, test as what I said.

Thanks
0
 
kopibeanAuthor Commented:
can you send me the sample template?

thank you very much.
0
 
ZvonkoSystems architectCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Accept: kopibean {http:#11876920}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Zvonko
EE Cleanup Volunteer
0
 
ZvonkoSystems architectCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Accept: madheeswar {http:#11867392}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Zvonko
EE Cleanup Volunteer

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 7
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now