You need to sign in to do that
Don't have an account?
s-control issue in changing URL
Hi,
There is changes to instance . but the developers write code in s-control like this:
var objOpp = new sforce.SObject("Opportunity");
objOpp.set("Id",C_OpportunityID);
objOpp.set("Change_Type__c","New");
objOpp.set("Change_Description__c", "New Contract");
objOpp.set("Contract_User__c", Name );
objOpp.set("Contract_User_Id__c", UserId );
objOpp.set("Contract_URL__c","https://emea.salesforce.com/"+C_ContractID);
I want to get the Url what ever it is in browser if the instance changes. I tried with "/" by deleting https://emea.salesforce.com but in opportunity display the ural is showing http:///contractID ...
can anyone tell how to resolve it..
thank you.
Getting rid of the absolute URL is the right thing to do. You probably mismatched the quotes when you tried it before. So it should look like:
objOpp.set("Contract_URL__c","/"+C_ContractID);
Hi,
Unfortunately Currently there is no way to get the current browser URL.
You can use the Hierarchy Custom settings for URL and you can access this in your scontrol.
In the Hierarchy Custom settings define the Default Organization Level Value.
assign the different URL for Sandbox and Production.
Below is the sample code:
Custom Objects Name: URL__c
Field in Custom object: ULR_Sandbox__c
{!$Setup.URL__c.ULR_Sandbox__c}
Thanks,
Kodiana
I tried same way but the output on opportunity is like this : http:///C_ContractID
C_ContractID is showing id which ever it get. any other advice please.
thank you,
rajesh
Even after trying with custom settings also?
If YES, Please put the alert for custom setting URL.
Thanks,
Kodisana
where is need paste this {!$Setup.URL__c.ULR_Sandbox__c} . in objOpp.set({!$Setup.URL__c.ULR_Sandbox__c}) or any other way to declare it..
thank you,
rajesh
Please try as below mentioned
objOpp.set("Contract_URL__c","{!$Setup.URL__c.ULR_Sandbox__c}"+"/"+C_ContractID);
I tried creating custom setting as you said but it gave error :
what i need to do now.
In the Object Name field do not put any extra space.
Use _ where ever you are having Spaces and this should be unique.
Like: Sample_Object_Name
he error i got while saving s-control: