You need to sign in to do that
Don't have an account?

Javascript Button Help
Hi,
I have the following jscript button. It checks the users permission set and work accordingly but it requies user to have "View Setup and Configuration" permission at the user level. We have users without that permission and not able to submit the records. Can someone please assist how to make this button work without assigning "View Setup and Configuration" permission to users? I am getting the following error.

I have the following jscript button. It checks the users permission set and work accordingly but it requies user to have "View Setup and Configuration" permission at the user level. We have users without that permission and not able to submit the records. Can someone please assist how to make this button work without assigning "View Setup and Configuration" permission to users? I am getting the following error.
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")} try { var result = sforce.connection.query( "SELECT Id " + "FROM PermissionSetAssignment " + "WHERE PermissionSetId = '0PSK00000004T11' " + "AND AssigneeId = '{!$User.Id}'" ); var psAssignment = result.getArray("records"); if ( "{!Pims__c.Status__c}" !== "Under Review" && psAssignment.length === 1 ) { var isContinue = confirm("Are you sure you want to submit ? Click OK to continue or Cancel to remain on the screen."); if (isContinue) { var PimstoUpdate = new sforce.SObject("Pims__c"); PimstoUpdate.Id = "{!Pims__c.Id}"; PimstoUpdate.Status__c = "Under Review"; var result = sforce.connection.update([PimstoUpdate]); if (result[0].success === "true") { location.reload(); } else { alert( "An Error has Occurred. Error: \r\n" + result[0].errors.message ); } } } else { alert( "Nopes" ); } } catch (e) { alert( "An unexpected Error has Occurred. Error: \r\n" + e ); }
Please close the thread marking this answer as Best Answer if it really helped. Closing the thread help others finding the correct answer.