开发者

Using javaScript with Custom entities in MS CRM 4.0

I have custom entity where the user is going to set a start date and i need a javacsript code that would let me set the value of another field (end 开发者_如何学Cdate) in the same form according to the specified start date. Thanks :)


in the onChange event of your start data field

var startDate = crmForm.all.proposedstart.DataValue; //substitute "proposedstart" by your entity's attribute name
if (startDate == null)
    return;
var endDate =  crmForm.all.proposedend.DataValue; //substitute "proposedend" by your entity's attribute name
if (endDate == null) {
    endDate = new Date();
}
endDate.setDate(startDate.getDate()+5); // add 5 days to the start date
crmForm.all.proposedend.DataValue = endDate;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜