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
Ravindar AdminRavindar Admin 

formula values are not getting in URL in Production

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 getting.
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#

Can anyone please guide on this. How to achieve this?
 
Best Answer chosen by Ravindar Admin
Shruti SShruti S
Can you please verify if the Field Accessibility of the fields involved is turned ON ?

All Answers

Shruti SShruti S
Can you please verify if the Field Accessibility of the fields involved is turned ON ?
This was selected as the best answer
PawanKumarPawanKumar
Field Visibility could be a problem for this. Please verify field visibility for this field.

To avoid you can use the following, you can add query before checking if condition and check against the queried value.
sforce.connection.query("");


 
Ravindar AdminRavindar Admin
Hi Shruti & Pawan,

The Field Accessibility is "hidden" in Production. But while deploying from sandbox the Field Accessibility  is "Read-Only" in Sandbox.
PawanKumarPawanKumar
Hi Ravinder,

You make it at least read-only for the user's profile who are gone to use this button.

Regards,
Pawan Kumar
Shruti SShruti S
You have to set the Field Accessibility seperately in the Production. You will have to make it visible to the desired users or profiles.