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
BharathwajBharathwaj 

update field

hi all,

 

i need to update a hidden field using Apex code.

Is that possible. If so please provide some inputs regarding it.

 

Thanks in advance,

Bharath

GoodGrooveGoodGroove

Bharathwaj,

 

as long as you do not specifiy 'with sharing' attribute for your class, there shouldn't be any problem 

 

 

Further Details can be found in the Apex Docu under Data Access Control

 

http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/pages_security_tips_data_access_control.htm 

Sebastian 

BharathwajBharathwaj

Sebastian,

 

i am able to update those fields as an administrator but a profile which has that field hidden is not getting updated.

am not using the keyword 'with sharing' in my code.

i was sure about it because when i make the field visible the output is there and when the field was invisible the output was not there.

 

Please help

 

Thanks,

Bharath

ThomasTTThomasTT

Are you using a custom controller? or standard controller extension?

At that time, there wasn't "with sharing" key word, but a custom controller runs as administrator and extension runs as the user's profile (I thought, now, "with sharing" key word works in the same way).

ThomasTT

BharathwajBharathwaj

Thomas,

 

i am currently using a standard save button only to save the record.

in the trigger also am using only before insert as condition.