RE: How to edit the Time Entry fields in Project Service Automation?
Hi, i found a way to modify it:
There is a js web resource called "TimeEntryViewModel.js". (msdyn_/Time/App/Scripts/ViewModels/TimeEntryViewModel.js)
For example, i needed to modfy the duration list, in the original form you have all hours and minutes, in our business we only use Half Day or Entire Day, so at least i was able to achieve it with this:
Original Code:
TimeEntryViewModel.prototype.durationList = function () {
var list = [];
var time = "";
var minutes = [0, 15, 30, 45];
var i = 0;
var j = 0;
for (i = 0; i <= 24; i++) {
for (j = (i === 0 ? 1 : 0); j < (i === 24 ? 1 : minutes.length); j++) {
time = DataUtils_1.default.hoursAndMinutesToTimeString(i, minutes[j]);
list.push({ key: time, label: time });
}
}
return list;
};
My Code:
TimeEntryViewModel.prototype.durationList = function () {
var list = [];
var time1 = "";
var time2 = "";
// var minutes = [0];
// var i = 0;
// var j = 0;
// for (i = 0; i <= 8; i++) {
// for (j = (i === 0 ? 1 : 0); j < (i === 8 ? 1 : minutes.length); j++) {
time1 = DataUtils_1.default.hoursAndMinutesToTimeString(4, 0);
time2 = DataUtils_1.default.hoursAndMinutesToTimeString(8, 0);
list.push({ key: time1, label: time1 });
list.push({ key: time2, label: time2 });
// }
// }
return list;
};
So basically from this:
To this:
You have a lot of other options there.
Of course this is unsopported and could break with an update.
Regards,