function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Custom Case Operations Work as Administrator but Not Normal Users

I have created an S Control which sits in the Fields list in a Case object.
The S Control is a link with an onclick event that runs javascript (also in the S Control).
The Javascript takes fields from the current case and creates a special case with specific information, a specific record type, and assigns the case accordingly.  The javascript also has some validation built in to prevent users from using this incorrectly.
Testing this, everything works 100% as expected while logged in as a System Administrator.
Logging in as a standard user, even though I have verified they have permission to view the record type, and all fields of the new record type, when the case is being created in the Javascript function the case number is 'undefined'.
Is there some place special I have to enable users to run S Controls?  I cant imagine that all the fields they can edit normally if they were to click the Edit button are disabled through script access.
I am using Try / Catch blocks, and there is no error coming back when using the normal account, just 'undefined' for the case number, and the creation fails.
I know the Try/Catch block is working properly because when I had invalid field names it caught those and enabled me to fix them. 
Does anyone have ideas on what this problem might be?
Greg HGreg H

I believe that the case number is generated by the system when the case is saved.  So the issue might be on the profile setup of the running user.  If they don't have create permissions on their profile then the case is not created and no number is generated.

Just a thought,
Thanks.  I will take a look into that.  I am almost positive it is permission related.  Everything is working great as administrator, it doesnt work at all as normal user.  Thanks for the reply.