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
anandakumar85anandakumar85 

S-control problem

Hi All
 
I have written a S-control to update a field.
 
The Problem is 'it is not working for few profiles'. What might be the reason.
 
Can anyone help in this.
 
Thanks in Advance
Anand
gmc74gmc74
Do those profiles have full access to the field?
 
I would start by comparing the profiles to each other, and adjust them little by little until you find the field that is giving you problems.
Greg HGreg H
Odds are it's one of two things.  Either the field level security for the field you want to update is not setup correctly for the profile. Or the profile doesn't have Edit permissions on the object.
-greg
anandakumar85anandakumar85

Hi

Yes. The problem was due to the Field Level Security settings.

Thanks for your help.

Anand

magdamagda
Hi,

i try to write a sControl Button to update a field. It is possible to have your code for this button?

Thx

Magda


Message Edited by magda on 02-21-2008 02:48 AM
Eyal_WizEyal_Wiz

Hi Magada,

did you manage to find the code for a s-control that updates a field?

Thanks

Eyal

magalie pickertmagalie pickert
yes :smileyvery-happy:

but it is depend on which kind of field you want to update


Message Edited by magalie pickert on 07-02-2008 05:54 AM
Eyal_WizEyal_Wiz
just one of the fields in a custom object that i've created.
 
I want to create a s-control that will be activated by clicking on a button and will check something in the record i'm in  and update a certain field according to this check.
 
Thanks
Eyal
magalie pickertmagalie pickert

 
which kind of field you want to update?

This is an example, maybe can this help you

Code:

{!REQUIRESCRIPT("/soap/ajax/11.1/connection.js")}
var obj= new sforce.SObject("obj__c");
obj.id = '{!obj__c.Id}';
// change value of object
obj.Status__c = 'Closed';
result = sforce.connection.update([obj]);
window.parent.location.href="{!URLFOR($Action.obj__c.View, obj__c.Id,null , true )}";

 



Message Edited by magalie pickert on 07-02-2008 06:53 AM
Eyal_WizEyal_Wiz

i'm getting an error so i'm probably missing something here.

do i need to install any ajax tools in my account in order for this to work?

Thanks

Eyal

TCAdminTCAdmin
Hello Eyal_Wiz,

What is the error you get? If you use magalie pickert's code you will not need to put it in to an s-control. It should be in an OnClick JavaScript button instead of an s-control. I'm not sure if that would be causing the error you are receiving.
magalie pickertmagalie pickert
o
could you please write your failure?

Do you know which APEX API you are using? If you don't use the 11.1, please change this number.

This code is running without problems on my application.
Magda

@TC Admin: it is an Execute JavaScript in a detail page Button


Message Edited by magalie pickert on 07-03-2008 10:22 PM
Eyal_WizEyal_Wiz
It's working now! Thank you very much for your help! Eyal