I just started working at a new place as software developer and they have put me on a project that needs to be improved as a way to get me started.
It's a sharepoint 2010 project and it's made up of C# and ASP. I have little experience at all in developing for sharepoint so I would like to ask for some assistance if possible. Basically they have a page with a lot of activies and each activity is supposed to try and save the company money.
Now, when you press "Edit item" a JavaScript executes and styles some of the table that is presented to you. Since this project was made in a rush there is no documentation and there are hard coded values. What I wanted to try first was to change the year numbers it displays as these are hard coded in. So I'd go from this:
var quarters = {
"Q3": {
title: "Q3",
name: "Q3 (MAR-MAY)"
},
"Q4": {
title: "Q4",
name: "Q4 (JUN-AUG)"
},
"2015-16": {
title: "2015-16",
name: "Budget year 2015/2016"
},
"2016-17": {
title: "2016-17",
name: "Budget year 2016/2017"
}
};
to this:
function getCurrentYear() {
var year = new Date().getFullYear();
return year;
}
var quarters = {
"Q3": {
title: "Q3",
name: "Q3 (MAR-MAY)"
},
"Q4": {
title: "Q4",
name: "Q4 (JUN-AUG)"
},
"CurrentYear-NextYear": {
title: getCurrentYear + "-" + (getCurrentYear()+1).toString().substr(2,2),
name: "Budget year" + getCurrentYear() + "/" + getCurrentYear()+1
},
"NextYear-YearAfterNextYear": {
title: (getCurrentYear() + 1) + "-" + (getCurrentYear() + 2).toString().substr(2, 2),
name: "Budget year " + (getCurrentYear() + 1) + "-" + (getCurrentYear() + 2)
}
};
But when I deploy the sharepoint site and use the "Edit Items" part, nothing that the JaveScript is supposed to do happens. I tried to debug but the debugger never actually enters the function that I try to use which leads me to believe that the website never uses the JavaScript in the first place.
My question is: Where would I check for a possible use of the script?
I searched throughout the entire solution and nowhere is the JavaScript file referenced but it works fine on production and the Revision History reveals nothing that would break the usage of the JavaScript.
getCurrentYearin one of your function calls.