Monsieur Winner

MS D365FO || Monsieur D365FO

Human ResourcesTechnical

Get employee year of service in D365FO – x++

Recently, I worked on an Integration which require employee to book loans and rent advance directly from D365FO and these requests hit the clients core banking application.

One of the requirement is the employee must have served a certain number of years to access these loans. This is actually shown on the employee details card as below:

 

To get the employee service duration via code, we do:

HcmWorker hcmWorker;
Hcmemployment hcmemployment;
real YearsOfSerrvice ;

      select hcmemployment where hcmemployment.Worker == hcmWorker.recid;
      YearsOfSerrvice = hcmemployment.yearsOfService();

Merci.

Komi Siabi

Komi Siabi is a Bilingual D365FO Solution architect who loves sharing his knowledge as he works on Both Francophone and Anglophone projects around the globe. He enjoys doing some tiktok videos in his leisure time.

Leave a Reply

Your email address will not be published. Required fields are marked *