Get All Mandatory Fields on a Form

Get All Mandatory Fields on a Form : Getting all mandatory fields on a form and making Non-Required through Js. function getRequiredFields() { debugger; var count = 0; Xrm.Page.data.entity.attributes.forEach(function (attribute, index) { if (attribute.getRequiredLevel() == "required") { debugger; var attributename = attribute.getName(); Xrm.Page.getAttribute(attributename).setRequiredLevel("none"); Xrm.Page.getAttribute(attributename).setSubmitMode("always"); count = count + 1; } }); alert(count); } That's It. … Continue reading Get All Mandatory Fields on a Form

Paging in Javascript to retrieve more than 50 records.

Paging in Ms Crm Javascript to retrive more than 50 records : By Default, through Odata query in js, we can get only¬† 50 records at a time. If want to get the next another records, then we can go with paging concept. function pagingvalidation() { debugger; var serverUrl; if (Xrm.Page.context.getClientUrl != undefined) { serverUrl … Continue reading Paging in Javascript to retrieve more than 50 records.

Validate Numeric’s for a Text Field

Allow Numeric's for a Text Field : //Validating¬† to allow only numerics for a text field. function numericvalidation(Context) { if (Xrm.Page.getAttribute("gb_weiver_amount").getValue() != null && Xrm.Page.getAttribute("gb_weiver_amount").getValue() != undefined) { var waiveramount = Xrm.Page.getAttribute("gb_weiver_amount").getValue(); if (waiveramount != null) { var rexp = /^[0-9]*$/; if (!rexp.test(waiveramount)) { alert(" Waiver Amount Must be Numerics. Please Enter Numerics ."); Xrm.Page.getAttribute("gb_weiver_amount").setValue(null); … Continue reading Validate Numeric’s for a Text Field