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
BAI-JonBAI-Jon 

S-control only completes correctly with admin

I have an s-control that run on a custom object.  It does several things.  The first part pulls information from an account that it is related to and updates fields in the object with info from the account.  This part works fine for everyone.  The second part creates cases based on boxes that are checked off by the user.  The third part is a set of tasks on each case.

When run as an admin, the cases create just fine.  When run under someone else, the cases don't create.  I've put in alerts through each step of the case creation, and it runs through them just fine.  I even have an alert to show the details of the case after it should be created and everything in the case looks fine.  It doesn't throw up any errors that i can find in firefox's error console and nothing in firebug either.

It seems like its a permissions issue, but it has me stumped.  Anyone have any ideas on this?  Your help would be greatly appreciated.
RainManRainMan
Yes... it's a permissions thing.  Believe it or not, you actually solved a problem I was having.  Just hearing the word permission triggered something.  THANK YOU!
 
Anyway, time to repay the favor.  Go to the setup/manage users/profiles and click on the users profile that needs access.  Scroll down the page and edit "Enabled Apex Class Access"   You should be able to figure it out from there.
BAI-JonBAI-Jon
Glad I triggered your thoughts and thanks for your reply.

I don't have any apex classes that i can add to profiles. Also, it doesn't look like i can create any apex classes since we are only on Enterprise.  Here is a quote from the help file about creating Apex:

You can add, edit, or delete Apex using the Salesforce user interface only in a Developer Edition, a Salesforce Enterprise Edition trial organization, or sandbox organization. In a Salesforce production organization, you can only make changes to Apex by deploying from the Force.com IDE, using the Force.com Migration Tool, or the Force.com Metadata API call deploy.


RainManRainMan
Oh sorry...  I thought for sure you were having the same issue.
CaptainObviousCaptainObvious
It sounds like one (or several) fields may not have the proper field level security settings. However, this should have shown up when you displayed the case details...
 
It's hard to tell without actually seeing the code. Can you post that part of the code where you create the cases?
BAI-JonBAI-Jon
Here is the code for the case i was testing.  The alert at the end displays everything about the case correctly.

        var impCase = new sforce.SObject("case");
        impCase.set("OwnerId",impUser);
        impCase.set("Status", "New");
        impCase.set("Origin", "Web");
        impCase.set("SFDC_Implementation__c", "{!SFDC_Implementation__c.Id}");
        impCase.AccountID = accountReferenceID;
        impCase.set("Subject", pipeName + " - Implementation");   
        impCase.set("Priority", "Medium")
        impCase.set("Type", "Pipeline");
        impCase.set("Anticipated_Close_Date__c", closeDatePlus30);
        var saveImp = sforce.connection.create([impCase]);
        impCase.set("Id", saveImp[0].id);
        var impCaseID = saveImp[0].id;
        alert(impCase);

CaptainObviousCaptainObvious
Try alert(saveImp);
BAI-JonBAI-Jon


Good idea, captain. So i at least know whats wrong now.  This may seem like a stupid question, but can you change the security settings on the ID fields?  They don't show up in the normal place where field security is setup.
CaptainObviousCaptainObvious
It may actually be the "Account Name", since it's a lookup.
BAI-JonBAI-Jon
You were right Captain, the "Account Name" look up field was set to read-only for that profile.  Made the change and it works fine.  Thank you for your help,  I appreciate it.