Forum Discussion
- PhillipDennisQrew CadetA third approach would be to use Javascript. This is the most powerful and flexible way to do it, but it takes some technical know-how. If you use Dan Diebolt's Image Onload technique to load a Javascript file whenever your form is opened, you can use simple jQuery to remove options easily based on user roles.
You can find out all the app's roles and the way they're represented numerically by looking at the source HTML of any QuickBase form. Search for roleinfo. The roles the current user is assigned to are held in a global variable called gReqUserRoleIDs.
Let's imagine you want to remove Item C from the dropdown for Field ID# 6 for anyone in the Assistant role. You learn from the HTML of a form that the Assistant role has a numerical value of 20. Write a few lines of Javascript like the following and save it as a code page:(function() {
Next, create a formula text field that will get a Javascript file using the Image Onload technique (if you're not familiar with this, just do a search for it). Add the field to your form, and Bob's your uncle. If a user opens the form who has role 20, Item C will be removed from the dropdown for Field ID# 6.
// check to see if the current user is in the Assistant role, number 20
if (gReqUserRoleIDs.search("20") !== -1) { // string.search() returns -1 if the search term isn't found, meaning, in this case, that the user is in role 20
$("select#_fid_6 option:contains('Item C')").remove();
}
})();- GauravSharma3Qrew CommanderHi Phillip,
Thank you for sharing this here. I will try this in one of my scenarios. :)
Thanks,
Gaurav - nitinbishtQrew MemberHi,
i have a relationship with Two table and i want to automatically select parent record on drop down in child form, can it be done if yes please help me with this.
------------------------------
nitin bisht
------------------------------- MarkShnier__You
Qrew Legend
@ nitin I suggest that you post a new question and explain what value you would like to Auto Populate.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
markshnier2@gmail.com
------------------------------
- LauraThackerQrew CaptainNot within a standard multiple-choice drop down. However; if you created a table of those options you could then permission roles based on records meeting a criteria; so their "drop down" selections would be restricted to the ones you want them to see.
You would create a table-to-table relationship between your "option list" and your main table to make selections. Consider making the key field of that table the name, unless it's possible for those options to change name values. - QuickBaseCoachDQrew CaptainA low tech option is to have a form rule
When multiple conditions are true
User is in the role particular
Choice is C
Action:
Change choice to blank
uncheck that checkbox at the bottom so that the rule always fires.
So its not hidden but the user won't be able to choose it and have it stick. - Stephony_DBH_Qrew CadetThank you!