Posts

Showing posts from August, 2022
Auto-populate  Lookup Values using JavaScript in D365 1. Create One Many Relationship or Many to One Relationship between any two Entities Ex: Account and Contact  a. Consider Account as A Parent Entity(Parent Table) and Contact as Child Entity(Child Table) b.1-N or N-1 relationship is created between them. So Lookup is Field is Available in Child Table c. Create some Columns which were similar to Parent Table i.e. Account and Child Table i.e. Contact Example Columns are:                              1.CompanyName(Single line of Text)  => new_companyname                              2.CompanyPhoneNumber(phone number) => new_companyphonenumber                             3.CompanyEmail(Email) => new_companyemail           ...

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)...