I want to change the appointment timing which is by default as 30 minutes to 1 hr. I can understand that I have to write a JavaScript. But I am unable to write the same. Can anyone please help me. Thanks in advance
I want to change the appointment timing which is by default as 30 minutes to 1 hr. I can understand that I have to write a JavaScript. But I am unable to write the same. Can anyone please help me. Thanks in advance
This code works. Thanks Alex.. :-)
Hi,
simple set the End time with Start Time +30 minutes and update the duration with 60 minutesvia JS onload event
function set()
{
if(Xrm.Page.ui.getFormType() == 1)
{
var start =Xrm.Page.getAttribute("scheduledstart").getValue(); // get start date time
var newDate = start.setMinutes(start.getMinutes() + 60); // +
//alert (newDate);
Xrm.Page.getAttribute("scheduledend").setValue(newDate);
Xrm.Page.getAttribute("scheduleddurationminutes").setValue(60); // this is duration
}
}
Pluggin assistance will also help me. Please help me.
I have tried this code, do not seem to work, is anyone there to help me write the code to change the default duration for appointment inside activities from 30 minutes to 60 minutes by default;
this is my code --
function SetDuration() {
alert("hit JS");
// FORM_TYPE_CREATE = 1
if (Xrm.Page.ui.getFormType() == 1) {
var attribute = Xrm.Page.getAttribute(sdm);
alert(attribute);
if (attribute.getValue() == null) {
attribute.setValue(new TimeRanges());
}
attribute.setValue(attribute.getValue().setHours(1, 0, 0));
}
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156