我在CRM 2013中工作,需要設置我的文本框的日期並將其保存到CRM 2013數據庫。堆棧空間異常
看看我的代碼:
VAR CRMForm = document.parentWindow.parent.Xrm.Page;
var currentDateTime = new Date();
CRMForm.getAttribute(「date」)。setValue(currentDateTime);
但我及彼的異常:堆棧空間不足
我在CRM 2013中工作,需要設置我的文本框的日期並將其保存到CRM 2013數據庫。堆棧空間異常
看看我的代碼:
VAR CRMForm = document.parentWindow.parent.Xrm.Page;
var currentDateTime = new Date();
CRMForm.getAttribute(「date」)。setValue(currentDateTime);
但我及彼的異常:堆棧空間不足
得到了解決自己及其如下:
var dt= CRMForm.getAttribute("date");
if(dt.getValue() != null)
{
dt.setValue(dt.getValue().setFullYear(currentDateTime.getFullYear()));
dt.setValue(dt.getValue().setDate(currentDateTime.getDate()));
dt.setValue(dt.getValue().setMonth(currentDateTime.getMonth()));
}
你在一個窗體或自定義的Web資源的工作?
我越來越困惑,因爲你所得到的父窗體,
var currentDateTime = new Date();
Xrm.Page.getAttribute("requestdeliveryby").setValue(currentDateTime);
這應該是綽綽有餘。請記住,編輯表單時需要正確註冊:
屬性 - >事件 - > OnLoad?看你的例子看起來像你試圖從錯誤的形式獲取Xrm命名空間。
的是,正在執行JavaScript的時候?什麼時候發生錯誤? – Daryl 2014-09-24 12:52:26
您的代碼邏輯可能導致無限循環,導致更改觸發該代碼再次運行。 – Zach 2014-09-24 17:20:16