You are on page 1of 12

Code URL Update Strategy

1) Open SharePoint Designer 2013.


2)

3) Click on “Open Site”.


4)

5) Type the site url and click on “Open”.


6)
7) When the site is opened, go to “Site Assets->JS” and create a new folder named
“CommonFiles”. (note: if the JS folder does not exits go to the folder where your other js
libraries exists)
8)

9) Go into the folder and create a file name “Constant.js”.


10)

11) Right click on the file and check out it.


12)

13) After check out again right click on file and click on “Edit file in Advance Mode”. And
then create a object name “Constant” for reference look the screenshot below
14)

15) Save the file in close it and check in the file.


16)
17) Now, Open the master page which is been used to add the constant script. In our case
seattle is the master page right click on it and edit in advance mode.
18)

19) Add the script tag right before the </body> end tag.
20)
21) Check in the master page and go to “List and Libraries”.
22)

23) Click on the list name i.e “PC”.


24)

25) Then click on “Forms”.


26)

27) Right click on form name and click on “Edit File in Advance Mode”.
28)

29) Find “http” keyword and replace the URL with the constant object we created.
30)

31) Be careful do not use “Replace All”. (constant will only work in javascript code not in
HTML tags)
32)
33) In few html tag we need to change the URL to our current site hard coded (Site
Collection Name).
34)

35) Press “Ctrl+S” to save and open the other list forms and do the same.
36) If hardcoded URL in style tag use following jquery function.
a. <script>
b. $(document).ready(function(){
c. $('.loadinggif').css('background-
image:',Constant.Sites.PFInterestFree+"/SiteAssets/ajaxLoader.gif",'background-
repeat:','no-repeat','background-position:','right','background-origin:','center'})
d. );
e. </script>
37)

38) Also need to update people picker get data function or command because meta-data
field value changes after migration. Some of them are as follow,
39) People Picker
a. var SCpeople = $().SPFindPeoplePicker({peoplePickerDisplayName: "Service
Champion *"});
b. SCpeople.contents[0].innerHTML
c. Use this command to get people picker value
40) On Button redirect URL.
a. Give URL from site collection name.
41)

You might also like