+ Start a Discussion
BAGELBAGEL 

Help Please. Static Resource in S-Control?

Hi there,

I upload some images & javascript files to Static Resource section. However when I try to access those resource in my S-Control by {!$Resource.resource_name}, it gives me a syntax error saying it does not exist. Do we allow to use Static Resource in our S-Control? If so, what did I do wrong? What is the correct way? Please help, and thanks in advance.
JackTinsleyJackTinsley
I've been hearing that certain aspects of S-Controls have stopped working with the latest update.  I've heard this from consulting companies that I was looking for some S-Control work and they had to put me on hold to figure out what was going on with some controls they had already done for clients.  Not sure if this is what's happening in your situation but figured I would throw it out there.
BAGELBAGEL
Thanks for your input. Anyone else has any ideas?
Greg HGreg H
Static resources cannot be used in sControls. You can create sControls that are "snippets" and include those in sControls but static resources are intended for Visualforce pages.
-greg
BAGELBAGEL
Ic...  Well, I am having problem with accessing document resource inside S-Control. It works ok within the organization. However if I install the app to a different organization, the links get messed up. We contacted Salesforce support, we got the following response. But I am not exactly sure what he meant and how to do it. If anyone knows, can you explain it in more details? Perhaps an example? Thanks a lot.
 
"If you create a query within the links to your internal items that call for the new ID then it will resolve to the new id for the document or object link. Prior to 156 the install use to change items within code to resolve this. Now its just requiring a bit more to resolve this."
 
 
Greg HGreg H
Their response is interesting.
 
I presume that you are not querying to get the id of your docs? So in your development org you have the Ids hard-coded and you were relying on Salesforce to handle the updating of those hard-coded Ids when the package was installed into other orgs.
 
I don't see how this is not considered a bug on salesforce.com's side. This sort of referencing to specific records has always been permitted in the past and as long as the record being referenced is included in the package for installation the integrity of that reference should be maintained.
 
I just opened a case for this same issue because I am encountering it with one of my apps.
-greg
BAGELBAGEL
Yes, that's exactly what I am facing right now. I was relying on app-install would do the job, and update the hard-code id correctly. To me, it is definitely a bug on salesforce side. Unfortunately, it doesn't sound like they will fix it anytime soon or at all. Do you understand what they mean by "query within links..."? I really hope that I don't need to end up rebuilding the whole app.