Link to home
Start Free TrialLog in
Avatar of kopibean
kopibean

asked on

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.
Avatar of madheeswar
madheeswar
Flag of Singapore image

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.
Avatar of kopibean
kopibean

ASKER

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??
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.
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!
>>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.
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.
Anyone can help me to solve this problem?
Pls advise.
THank you.
YEs. view_x holds all type of roles.

This will work. Did u tried?

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.
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.
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.
ASKER CERTIFIED SOLUTION
Avatar of madheeswar
madheeswar
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can you send me the sample template?

thank you very much.
Avatar of Zvonko
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
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