Posts

Custom Employee Lookup using SysTableLookup (Past Workers Example)

// Event handler on Employee Name control in HcmWorkerV2 form [FormControlEventHandler(formControlStr(HcmWorkerV2, HcmWorker_EmployeeName), FormControlEventType::Lookup)] public static void HcmWorker_EmployeeName_OnLookup(FormControl sender, FormControlEventArgs e) {     SysTableLookup          sysTableLookup;     // Lookup object     Query                   query = new Query(); // Query object to build custom lookup     QueryBuildDataSource    qbdsDirPerson, qbdsHcmWorker, qbdsEmployment;     // Step 1: Base table = DirPerson (employee details)     qbdsDirPerson = query.addDataSource(tableNum(DirPerson));     // Step 2: Join HcmWorker with DirPerson     qbdsHcmWorker = qbdsDirPerson.addDataSource(tableNum(HcmWorker));     qbdsHcmWorker.relations(true);                ...

Generate and Return Salary Slip PDF via Custom API in Dynamics 365 Finance & Operations

  Content: In this blog, I will share how I implemented a custom API in Dynamics 365 Finance & Operations to generate a Salary Slip (PDF) for employees and return the file details as a response. Business Requirement The requirement was to generate a Salary Slip PDF for an employee, save it on the server, and send the following information back to the API response: Employee ID File Path (server directory) File Name Full Path (complete physical path) Response Contract Code [DataContractAttribute] public class SalarySlipResponse {     str filePath;     str fileName;     str fullPath;     str employeeId;     [DataMemberAttribute("FilePath")]     public str parmFilePath(str _filePath = filePath)     {         filePath = _filePath;         return filePath;     }     [DataMemberAttribute("FileName")]     public str parmFileName(...