+ Start a Discussion

Best way to edit scontrols

I am starting to develop more and more scontrols and am getting bored of pasting the code into the web page when I want to run/debug it.

I thought I'd found my saviour when I found the announcements about the eclipse integration -- I then spent the next few hours trying to install it and, at the last hurdle, it all failed.  I can't get eclipse to install any of the 'The Eclipse Project' updates to eclipse.  I just get errors.

As well as that, I can't find any information about how to use eclipse with salesforce...the link: http://adnsandbox.com/appexchange/updates/ gives me a 404 and I can't find anything anywhere else.  Has the eclipse integration gone out of fashion?

Any way - can anyone help me with tips on how best to edit the s-controls.  If that is eclipse, then how do I get it all installed.

Thanks in advance.
Hi BenBeaumont,
If debugging s-control code is what you are looking for, you dont need eclipse to do that.
If you are using IE, just Enable Script debugging from the IE Properties>Advanced Tab,
Set breakpoints in an editor / debugger such as MS Visual Studio, Replace the Logon Credentials with
your actual Logon Credentials, Set the SessionID and go.
There is a Firefox debugger also available now...
Hope that helps.
bssantosh, thanks for the reply.  Debugging is so much of a problem - I find firefox's java console and performing logging to the page is good enough.  I'll keep your suggestions in mind.

However, it's more the ability to edit the code conveniently that I'm thinking of.  Editing the code in a form text box on the salesforce site isn't easy, and I don't see anyway of using a normal editor except by cutting and pasting the code after editing into the form in salesforce.

What I am doing is I am using Notepad ++ and have two tabs open in FF one in the scontrol page and one on the page of salesforce I want to test and effectively I cut and paste my code each time, a bit time consuming but the eclipse toolkit never seems to work for me so I dropped it.

Sounds like you're where I'm at - it's frustrating while I'm debugging.

However, is there some kind of ftp access or something similar that I can use in an editor that works?  Or is there a way to get eclipse working, plus some instructions?

I've just worked eclipse out - and it's so much easier.

I suddenly noticed that the salesforce integration required eclipse 3.1, so I downloaded teh WTP release 1.0.x instead of 1.5.x.  In fact I downloaded the all-inclusive version from http://download.eclipse.org/webtools/downloads/drops/R1.0/R-1.0.3-200607290929/

Then, the auto-update thingamy to (http://adnsandbox.com/appexchange/updates) worked.

I've just tested it and it's much nicer to be able to edit the code and just use Ctrl-S to save, no more pasting for me. 

Thank you whoever wrote the eclipse plugin.


When I am doing this each time I try to save my s-control I have an IO error entity type....

Thanks for your help
thingamy (sorry spelt it wrong):

thingummy (noun): - something whose name is either forgotten or not known


As for your IO error, I wouldn't have a clue, have you tried a clean install of eclipse, or turning off firewalls, or something similar?

This is somewaht a clean install of eclipse, I do not have access to my company firewalls so ? but I can login and get my scontrols but not able to save when I change my scontrols. What version do you have of the Appexchange plugin in Eclipse?

Can you make a screenshot of your product configuration in Eclipe Please.


Message Edited by The_Fox on 08-22-2006 03:04 PM

I have version 1.0.2206 of the appexchange eclipse toolkit (and documentation)

What do you want me to take a screenshot of?  Do you mean the 'About Eclipse SDK Plug-ins' table?
Help>Software Update>Manage configuration

Thanks in advance
Have a look at this page here:  http://img123.imageshack.us/img123/3405/eclipseconfiggt2.jpg

Do you need all the branches expanded?
No Thanks,

I am a newbie with eclipse but this is very strange behavior

Some of you may laugh, but I use VIm to edit code.  I get my s-controls working as a standalone file before uploading to salesforce, I make a couple changes, and then copy/paste it into salesforce.  Works for me.

If you're interested in getting it running as a standalone, the only things I do are use this .js file:
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js?browser=true;" type="text/javascript"></script>

Instead of this one:
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script

and put the login call in the init function:

function setUser() {
    if (window.XMLHttpRequest) sforceClient.appType = Sforce.Application.Type.FireFox;
    sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_70}", false);

    var loginResult = sforceClient.login("my username","my password");


Works for me, but everyone has their way of doing things.  I didn't have the patience to get Eclipse working and I've been using VIm for years now... It's just easy for me.
Just to chime in... I started with the model of "Develop it in a standalone web browser and then move it over when done".  I used Dreamweaver because it has all sort of build in syntax checking, code highlighting, etc.  You rapdily start running into the problem of trying to use "{!whatever}" constructs.  External to Salesforce they have no value so you have to workaround them for testing and that starts getting convoluted.

So, I migrated to Eclipse awhile ago, it's great as far as hitting ^s and having your changes automatically updated to the s-control.  However you can run the risk of getting your on-disk respository out of whack with the SFDC-repository of s-controls, especially if you juggle tools (like vim :-) ), or don't *always* use Eclipse.  So, you end up refreshing the Nature from time to time.

Having said that Eclipse is clearly the way to go.  I'm running a dedicated workspace for Salesforce stuff, version 3.1.2  Build id: M20060118-1600.  I didn't build it myself, I used one of the Windows images.  I pointed the Update tool at: http://adnsandbox.com/appexchange/updates/  (But that seems down now).  And, that's about it!

One caveat, your Eclipse Configurations contain the Salesforce Username/Password information in cleartext, so be careful before you just send it out. 

Steve Bower

Luckily I am developing an sControl which does not use merge fields... so I can use the "Develop it in a standalone web browser and then move it over when done" mthod as you mentioned, Steve.
It looks like in the future I will have to get on the Eclipse bandwagon however...  I better bookmark this thread...heh.