Posts

Showing posts with the label Calculating Age in D365 using JavaScript

Calculate Age using JavaScript in D365

Image
 Calculate  Age using JavaScript in D365 To get Age Value Using JavaScript prerequisites are : 1. Create A Date Column (Field) in Table(Entity) and name it "Date of Birth" or "DOB"      Copy the Schema Name : Ex: new_dob ; 2. Create An  Age Column(Field) in Table (Entity) and name it "Age"         Copy the Schema Name : Ex: new_age ; 3. Write A JavaScript Code in any Editor as below or directly in WebResource function   getAge(executionContext) { debugger  // Used for debugging Errors var formContext = executionContext.getFormContext();  var dob = formContext.getAttribute(" new_dob ").getValue();                  //Getting value from dob field var today = new Date();                                // getting current date value and storing in "today" variable var birthdate = new Date(dob)...