http://garethtuckercrm.com/2011/03/16/jscript-reference-for-microsoft-dynamics-crm-2011/
Somar data e incluir no campo
var data = Xrm.Page.data.entity.attributes.get("sof_data").getValue(new Date());
var lembrete = Xrm.Page.getAttribute("sof_lembrete").getValue();
var dataWorflow = new Date().setDate(data.getDate()+lembrete);
Xrm.Page.getAttribute("sof_datawokflow").setValue(dataWorflow);
Função para setar hora no campo
function SetTime(attributeName, hour, minute) { var attribute = Xrm.Page.getAttribute(attributeName); if (attribute.getValue() == null) { attribute.setValue(new Date()); } attribute.setValue(attribute.getValue().setHours(hour, minute, 0));} //Chama a função e seta para 8:30amSetTime('campo_data', 8, 30);
Nenhum comentário:
Postar um comentário