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
KavitaKavita 

Import S controls from Developer edition to Enterprise edition

I created scontrols in my developer edition account and everything works great.
 
I am now trying to create the same scontrol in my enterprise edition account but the values come up blank.
 
Is there something very obvious I'm missing?
 
An example of one of the s-controls is below (calculates total cogs by bringing over COGs from the Poduct object and multiplying it by a qty on the opportunity product object)
 
 <script type="text/javascript">
var num1 = ({!Product2.COGS2__c});
var num2 = ({!OpportunityLineItem.Test__c});
var result = ""
if (num1 && num2) {
result = Math.round(num1 * num2 );
document.write(result);
}
</script>
 
sfdcfoxsfdcfox
Check the names of the fields... or you can just use this script...

Code:
{!Round(NullValue(Product2.COGS2__c,0)*NullValue(OpportunityLineItem.Test__c,0),0)}
Salesforce will automatically place the value into the S-Control area for you without the browser having to run any code at all. Be sure to "check syntax" before you save.

~ sfdcfox ~

KavitaKavita
Thanks so much for your help.