RE: Custom attributes in fields in an entity
Hi Sunayana,
to achieve this dynamically, You can create another field(type: Whole Number) to maintain the minimum length for your field and you can fetch the length dynamically. Now, the Arun's JS will look like this:
function TemsAndCondtitionsValidation(Excontext)
{
var termsConds = Xrm.Page.getAttribute("new_termsconditions").getValue();
var minimumlength=Xrm.Page.getAttribute("new_minimumlength").getValue();
if(termsConds.length < minimumlength) {
Xrm.Utility.alertDialog("The length of characters entered are less than the minimum requirement of "+minimumlength+" characters");
context.getEventArgs().preventDefault(); // cancel save
}
}