0

I created a custom button on custom object.

Behavior= "Execute Javascript"

Content Source="Onclick Javascript"

I have written the following code in sandbox. It is working in Sandbox. But, In Production, Formula values are not coming.

          if({!productForce__c.Channel_code__c<>'Z0'&&productForce__c.Channel_code__c<>'Z4'}) {
   alert('{!$Label.Alert_for_projected_stock}');
   } else {

   window.open("https://{!productForce__c.SAP_Environment__c}.corp.inpkg.net:{!productForce__c.PORT_for_SAP_URL__c}/sap/bc/webdynpro/sap/zbu_apo_projected_stock?sap-language={!productForce__c.Language_Code__c}&company= 
{!productForce__c.Country_Name__c}&BASEPRODUCT= 
{!productForce__c.PBcode__c}&OK_CODE=EXECUTE#");
   }

sanbox URL when we click on button: https://scmdev.corp.inpkg.net:8400/sap/bc/webdynpro/sap/zbu_apo_projected_stock?sap-language=FR&company=FRANCE&BASEPRODUCT=8022735&OK_CODE=EXECUTE#

Production URL when we click on button: https://corp.inpkg.net/sap/bc/webdynpro/sap/zbu_apo_projected_stock?sap-language=&company=&BASEPRODUCT=8006451&OK_CODE=EXECUTE#

3
  • please check those fields are present in production you used in javascript. If both of them are not not in sink.There may be probability to get the error.cross verify it once Jul 5, 2018 at 10:50
  • Check their permission as well. Jul 5, 2018 at 10:52
  • I have found in community, Salesforce eliminate the use of JavaScript in hyperlink formula fields. developer.salesforce.com/forums/?id=9060G000000MQknQAG
    – Ravindar D
    Jul 6, 2018 at 6:55

1 Answer 1

0

Only execution of Javascript in the hyperlink has been eliminated by salesforce in summer 17 release. I think in this case the issue might be because of fields are not available in prod. or else might be issue with the field permissions.

1
  • The Field Accessibility is "hidden" in Production. But while deploying from sandbox the Field Accessibility is "Read-Only" in Sandbox.
    – Ravindar D
    Jul 6, 2018 at 9:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .