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
blabla 

Any SControl examples around? possibly in Java..

Does anyone know of any examples/samples/docs for creating SControl s? I can't seem to find any good docs.


Thanks.
DevAngelDevAngel

Hi bla(?),

When approaching sforce controls, it is helpful to think in terms of the browser.  By this I mean an sforce control is html.  Sounds simplistic and limited at first.  HTML is very flexible in that it can refernce other objects and have them rendered in the browser.  So if you are building an sforce control that is at all interesting, you need to find some medium that can use the hosting capabilities of the browser.  This can be java script, dhtml, applets, activex, flash or other emerging technologies.

So, then, to do more than just write static html and actually consume data from salesforce.com or another web service or, possibly, even a back office system, the medium needs to be able to send and recieve requests in this browser page context.  The important concept is that what ever you create your sforce control "out of", it needs to be able to be hosted by the browser.

As an example, consider a simple activex control that displays salesforce.com data in a grid.  To build and test this you would create an activex control project in Visual Studio, add a grid, add some code to use msxml or wininet to consume web services, add some public properties to allow the browser to pass intialization information to the control and away you go.  Testing would be done in an html page that acts as a container.

I mentioned initializaiton information.  When creating an sforce control it is created in the context of one of the objects in salesforce.com.  This means that at the end of the day, the link that will invoke the control will live on a contact page, or an account page or whatever.  When creating the sforce control you have a merge like capability that you can take advantage of when the control is invoked.  The way this is used is like a mail merge, but the target document is the html that is hosting your control.  In this way you can get the context in which to run the control.  You have access to all the fields on the particular object that your control is related to as well as other non-object specific fields such as sessionID and userID and serverURL etc.

In the coming weeks we will be publishing more detailed samples and information on creating and use sforce controls, so, be patient, creative and stay tuned.

 

blabla
Thank you very much for the response. I think I am beginning to understand a bit more. Am I correct then in assuming that I can only access, or call my scontrol from a link in, for example, a contact? Is there any way to add a UI component that isn't necessarily contained in a salesforce object? Something that is viewable regardless of where I am looking at a lead, a contact, a task, etc.

thanks again.
adamgadamg
The scontrol itself does not have to access a particular sforce object, but it can only be referenced/accessed from a WIL appearing within the "useful links" section of a layout.
DevAngelDevAngel
Adam is correct.  So, one way to make a link available across objects is to add the same WIL to a bunch of different objects.
Ron HessRon Hess
So I have an "OCX" file, created from VB6.0 as an active X control, is that the file which I upload as single file in the scontrol edit page?
adamgadamg

Whatever binary you would normally use to manage your applet/control (JAR, CAB, etc) is what you would upload.

I think you need to package the OCX in a CAB, no?  I'd also recommend signing the CAB (even with a fake/test cert) as IE frowns on unsigned CABs.

DevAngelDevAngel

Hi Ron,

You should use the Package and Deploy wizard in vb 6 to create a cab file.  Upload this cab file in the scontrol and reference it in the object tag for the code base.

Michael SMichael S

If I have an ActiveX control as a .cab file, what should the codebase attribute be for the Object tag?

Given object.cab that I uploaded to sforce as a control.

should it be

codebase="http:object.cab"?

DevAngelDevAngel

Hi Michael S,

There is a merge field available that points back to the cab file that you use as a code base.

 

<OBJECT ID="collateralList" HEIGHT=100% WIDTH=100%
CLASSID="clsid:C37EEBCE-F222-4AF9-961E-945A7ED5F66E"
CODEBASE="{!Scontrol_URL}#version=1,0,0,0">

kadevkadev

Have the examples and samples of scontrols been made available yet?

Can Scontrols access data from sforce custom objects?  How do you reference the fields?

You reply said "You have access to all the fields on the particular object that your control is related to and..".   What does this mean?   How do you specify or know which fields a control is related to?

DevAngelDevAngel

Hi kadev,

sforcecontrol samples are not yet available, we are still deciding on what samples might best demonstrate the technology.  One type of sforcecontrol is a variation on the web integration link.  This type of "control" would be a simple browser redirect to a jsp or asp or other kind of server side web page hosted on your web server.  The redirect would include relevant information like a session id, a contact id or account id and so on.  Your web page would then extract the relevant info from the query portion of the url that goes to your page and, using the api, your server would make the appropriate calls for displaying a web form or what ever you wanted to do.

Another way to implement an sforcecontrol would be an activex control that is embedded in the sforcecontrol html source.  This control could then make web service calls using whatever technology that you like to use for that purpose.

Still another way to implement an sforcecontrol would be to write javascript that can make web services calls. 

The key is that the sforcecontrol is a browser based technology hosted on the salesforce.com servers.  So, whatever you can do in a web page you can do in an sforcecontrol.  Maybe it's flash, I believe you can write a flash applet that can make web service calls.

The quoted comment in your post has to do with where sforcecontrols are placed in the app.  sforcecontrols can live on any page that you can modify the layout for.  So, if you are placing the control on an account page, you would probably want to have the account id passed to your control to provide context.  Likewise, if it were on a contact page, you would probably want to pass the contact id to the control.

This info is passed by using "merge fields".  The available fields are shown on the sforcecontrol creation/edit page.  Familiarity with that page will go a long way to understanding the data that's available and how to use it.

 

Ron HessRon Hess

I've gotten around to building my first ActiveX control talking to salesforce, and have an easy question

In the build- test - upload sobject and test again process :

the test machine does not always run the most recent version of the control, is this due to my trying to re-use the classid ?

what is the smallest change ( version ? ) that I need to make to ensure that the newly uploaded control is downloaded and run.

I guess this is really a browser / active x question, so thanks in advance for any replies!

 

Ron HessRon Hess

ok, i think i've answered my question.

changing the version should cause the new object to be executed by the browser , even if the class id is the same.

not sure why this appeared to be not working for me earlier.

be sure the version in the codebase attribute matches the version generated by the compiler and stored in the CAB. 

raduradu
It's May already and you said that you were about to post some javascript scontrol samples (on January). Any news yet? Is it really working? Thanks!
saarikosaariko
June 2006, any news on Scontrol examples/samples?
gsickalgsickal
Yes, see the link below for the latest version of the toolkit which includes a few samples. You can also search the boards in the scontrols forum and you will find numerous examples and references to apps on the appexchange you can download which contain even more sophisticated scontrol samples...

http://blog.sforce.com/sforce/2006/04/ajax_toolkit_be.html