Skip to main content
Nintex Community Menu Bar
Question

How to use isAccessible() functionality in SKUID

  • Jul 10, 2024 12:27 AM UTC
  • 6 replies
  • 50 views
  • Translate All

Forum|alt.badge.img+6

Is there a way to access salesforce isAccessible() method in SKUID?

I have a button that needs to be displayed only for particular set of users who could have access given by  a permission set or a profile.

Thanks in-advance.

This topic has been closed for replies.

6 replies

Forum|alt.badge.img+13

Yes the “accessible” property on Model Field metadata will tell you this. You can get access to Field metadata from JavaScript via the “getField” Model API method as long as the field is in your Skuid Model. So for instance if the Contact Birthdate field is in a Skuid Model on your page called “Contact” you can do this:

var birthdateFieldIsAccessible = skuid.$M(‘Contact’).getField(‘Birthdate’).accessible;

Translate

Forum|alt.badge.img+6

Thanks, That helps Zach, I got another question, Is it possible to render a Global Action of a Table component with javascript? (I want to display the action button on the table based on the permissions of a custom object)

Translate

Forum|alt.badge.img+13

Hasantha, what I would do is this: setup a “dummy” Model, e.g. a Model on the Account object, with “Create default row if Model has none” set to true, and “Load Model data on page load” turned OFF. Add a Ui-Only field on this Model called something like “HasPermissionToUseGlobalAction”, that’s a Checkbox / Boolean field. Then you can Conditionally Render the Global Action based on the value of this field. THEN, use JavaScript to populate the value of this Ui-Only field on your dummy Model on initial page load, or whenever you’re able to determine whether to display it or not.

Translate

Forum|alt.badge.img+6

Thanks Zach, your solution worked! 🙂

Translate

Forum|alt.badge.img+2
  • Jul 10, 2024 1:03 AM UTC

Hello Zach, I’m trying your solution… just a question: when you said “THEN, use JavaScript to populate the value of this Ui-Only field on your dummy Model on initial page load” how can I do it? I tried adding the following to the function " $(document.body).one(‘pageload’,function() "

skuid.$M(‘Permission’).getField(‘HasPermissionToPromoteScenario’).Value = true;

where “Permission” is my dummy model.


but it doesnt work… If I remove the JS line and I load the page, when I inspect the attribute of “skuid.$M(‘Permission’).getField(‘HasPermissionToPromoteScenario’)” there is not a “Value” attribute.

Translate

Forum|alt.badge.img+2
  • Jul 10, 2024 1:03 AM UTC

I figured it out!

Translate