+ Start a Discussion
pupilstuffpupilstuff 

how to change the URL for production

Hi ,

 

By mistake I wrote code for devbox which not going to work at the time of deployment

 

Please let me know how to change this code , so It can work out in QA and production

 

url='/500/e?cas5=Incident&ent=Case&nooverride=1&&retURL=%2F500%2Fo&RecordType='+results[0].Id+'&CF00NW0000000Fgdg='+result12[0].Name+'&cas4='+result13[0].Name+'&00NW0000000FsWb='+results[0].name;

Andy BoettcherAndy Boettcher

What about the string won't work in Production - the Ids?  

raseshtcsraseshtcs

Just replace the ids that you are using in the URL with the ids of the corresponding fields' id in the production environment. In case you have refreshed the devbox from production after creation of the fields the ids would be same and you dont have to worry.

 

pupilstuffpupilstuff

Thanks for the reply ,

 

But Cant I change here itself means in devbox

raseshtcsraseshtcs

In any case you need to make the changes in the devbox before you move the code to production as you cannot change the code directly in production. What you need to do is to go to production get the corresponding ids for the fields from there make the changes in the devbox and then deploy the modified code to production.

 

On a second note you should use custom settings instead of hardcoding the ids in the URL as in this case you can use the custom settings to get the values for devbox/production whichever is relevent in the case.

 

Pls let me know in case you need more on this....

pupilstuffpupilstuff

Cam you tell me which fields wont work in production from this URL

 

url='/500/e?cas5=Incident&ent=Case&nooverride=1&&retURL=%2F500%2Fo&RecordType='+results[0].Id+'&CF00NW0000000Fgdg='+result12[0].Name+'&cas4='+result13[0].Name+'&00NW0000000FsWb='+results[0].name;

pupilstuffpupilstuff

Hello,

 

Very very thanks for the reply

I am interested for the second solution, but can you tell me what do you mean by custom settings with example

 

 

Thanks

 

raseshtcsraseshtcs

my best guess is that CF00NW0000000Fgdg and 00NW0000000FsWb wont work in production. you can confirm by checking if these ids exist in production or not. Replace the ids with the corresponding ids in production.

For more information on custom settings use the following link.

 

https://login.salesforce.com/help/doc/en/cs_about.htm

 

What you need to do is to store the ids in the custom settings with a production and devbox id and in the code you need to check which id to use appropriately depending on which box you are in.

 

Let me know if u need more on this..