function Age() { if(Xrm.Page.getAttribute("birthdate").getValue() != null) { var DOB = Xrm.Page.getAttribute("birthdate").getValue(); var Today = new Date(); Today.setHours(0, 0, 0, 0); var db = 0; if(DOB > Today ) { alert("Please Enter Genuine BirthDate !!!"); Xrm.Page.getAttribute("birthdate").setValue(null); } else { db = Today.getFullYear() - DOB.getFullYear(); var x = Today.getDate() ; var y = DOB.getDate() ; var a = Today.getMonth() + 1; var b = DOB.getMonth() + 1; if((a < b) || (a==b & x < y)) db=db - 1; } Xrm.Page.getAttribute("bm_age").setValue(db.toString()); //var control1 = Xrm.Page.ui.controls.get("bm_age"); //control.setDisabled(true); } }
REAL TIME WORKFLOW (PLUGİN YERİNE KULLANACAĞIZ) Faydalı linkler türkçe https://technet.microsoft.com/tr-tr/library/dn531057.aspx https://technet.microsoft.com/tr-tr/library/dn531067.aspx https://technet.microsoft.com/tr-tr/library/dn531149.aspx Real time workflow, bir kayıtta yapılan değişiklik anında işlem yapar. Eski tip asenkron workflowdan farkı anlık iş yapmasındandır. Bu iş akışı tipiyle form üzerinde de güncelleme yapabiliriz. Kaydet e bastığımız anda değişiklik forma gelir. Fakat kötü tarafı hata yaparsanız kullanıcı kaydedemez. Bir diğer negatif tarafı her real time iş akışı kaydette gecikmelere yol açar. O yüzden analiz aşamasında gerçekten real time olmalı mi diye kara verirken bunları da göz önüne almak gerekir.
CRM 2013 Javascript Special Functions http://shanewcunningham.blogspot.com.tr/2014/04/crm-2013-javascript-special-functions.html •Xrm.Page.context.client.getClient() – Returns client type i.e. outlook, web or mobile. • Xrm.Page.context.client.getClientState() – Returns client state i.e. online or offline. •Xrm.Page.data.refresh() – This is one interesting as it refreshes the data on the form without even reloading the page. This also enables developers to pass a callback method. •Xrm.Page.data.save() – Save the form • Xrm.Page.data.getIsValid() – Returns true is form is valid for save else false • Xrm.Page.data.setFormDirty() – Sets the form dirty for force save. • Xrm.Page.data.entity.getPrimaryAttributeValue() – Returns the value of primary attribute •Xrm.Page.ui.setFormNotification(message,level,uniqueId) – Sets the notification on top of the form. •Xrm.Page.ui.clearFormNotification() – Clears the form notification •Xrm.Page.ui.refreshRibbon() – Refreshes the ribbo...
Yorumlar
Yorum Gönder