![]() |
#15 |
Moderator
|
Все еще работает. Добавил веб ресурс "Dialog.html":
X++: <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>Open Appointment</title></head> <body> <script src="ClientGlobalContext.js.aspx" type="text/javascript"></script> <script src="fixrm_OpenAppointment" type="text/javascript" ></script> <form action="fixrm_Dialog.html" method="post"> <input type="button" value="Open New Appointment" onclick="OpenForm()" /> </form> </body> </html> X++: function OpenDialog() { Xrm.Utility.openWebResource("fixrm_Dialog.html", null, 300, 30); } function OpenForm() { var now = new Date(); now.setMinutes(now.getMinutes() + now.getTimezoneOffset() * -1); var parameters = {}; parameters["subject"] = "Test"; parameters["scheduledstart"] = toLocalISODateString(now); Xrm.Utility.openEntityForm("appointment", null, parameters); } function _twoString(number) { return number > 9 ? "" + number : "0" + number; } function toLocalISODateString(date) { if (date.toISOString == undefined) { var isoDateString = date.getUTCFullYear(); isoDateString += "-" + this._twoString(date.getUTCMonth() + 1); isoDateString += "-" + this._twoString(date.getUTCDate()); isoDateString += "T" + this._twoString(date.getUTCHours()); isoDateString += ":" + this._twoString(date.getUTCMinutes()); isoDateString += ":" + this._twoString(date.getUTCSeconds()); isoDateString += "." + this._twoString(date.getUTCMilliseconds()); isoDateString += "Z"; return isoDateString; } else { return date.toISOString(); } }
__________________
http://fixrm.wordpress.com, снятие/наведение порчи. Быстро, дорого, гарантия. ![]() ![]() |
|
|
|