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
Venk_ModelMetriVenk_ModelMetri 

Merge Fields & JavaScript

I am trying to create a SControl in the opportunity page using a web integration link. To pass some fields to the SControl, I understand that we can use merge fields. Since we are planning to use client side JavaScript/HTML in the SControl, how will the merge field be available to the SControl?

I noticed some sample code posted by Dave. he just specifies the name of the merge fields in the HTML. Will this work the same for JavaScript?

 

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

 

Most importantly, do we have any sample code with JavaScript (making a call to Sforce to update something or create something)

 

Thank You

Venk

DevAngelDevAngel

Hi Venk,

The values from the merge fields can be made available to javascript by using syntax like:

<script>

<!--

var x='{MERGE_FIELD}';

-->

</script>

For making calls to the API directly from Javascript, you will need to use MSXML as a com object embedded in your page.  JS does not have any native capability to do this.

Cheers