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
anagramanagram 

Where to store S-Control setup/preferences data?

Hi- Apologies if this is a basic question but I'm developing an S-Control and am looking for the best way to store some simple preferences data for the s-control. There will be an html user interface with some checkboxes and radio buttons and I'd like to store the user's preferences somewhere in the user's profile and be able to recall the settings inside the S-Control.

There must be an easy way to do this but I just can't find any info anywhere!

Thanks!
Nicholas
werewolfwerewolf
*sigh*.  Right now you have to put it in a custom object.  You can also add an Apex trigger to the custom object to ensure that the user is unable to create more than one of them.
anagramanagram
ok I guess I'll go that route!

Probably another silly question... is there a way to have Salesforce host small images and other resources that an html s-control might reference? Or must they be on an external server?

To Salesforce engineers: the Google Gadgets model is a good one to emulate here. Google can host EVERYTHING for your gadget - javascript, html, images, etc. They also have a preferences API for storing basic user preferences data.

Nicholas
jpizzalajpizzala
You can put your "small images and other resources" in the Documents section and reference them with the following relative servlet call:

/servlet/servlet.FileDownload?file=sfid

Where "sfid" is the unique Salesforce Id for the desired object. Note that this is not the best solution, especially if you are transferring this logic across orgs.

Another option you can look at is Salesforce Content which allows you to upload a directory structure and reference the contents much more easily. This feature is available for an additional cost on PE, EE and UE. More info on Salesforce Content here.


Message Edited by jpizzala on 04-01-2008 03:14 PM
anagramanagram
Great tip, thanks! This has gotta be deployable on appexchange though, so not sure those ideas fit.

Good to know the options are out there so I can tinker with them...

Nicholas