Posts

Showing posts with the label excel

AX 2012 Export user security role information to CSV file

static void VN_GetUserSecurityinfo(Args _args) { str                         fileName; boolean                     HasRecord; SecurityUserRole            securityUserRole; SecurityRole                securityRole; SecurityTask                securityTask; UserInfo                    userInfo; SecurityRoleAllTasksView    securityRoleAllTasksView; OMUserRoleOrganization      roleOrganization; OMInternalOrganization      internalOrganization; TextIO                          io; Str                             text; FilePath                        sourceFilePath; FileIOPermission                perm; #File    ;     fileName = "C:\\TEMP\\securityrolesusers.csv";     perm = new FileIOPermission(filename, #IO_WRITE); perm.assert(); text = 'User,RoleName, Organization,UserName\n'; while select securityUserRole        join securityRole         where securityRole.RecId == securityUserRole.SecurityRole             join userInfo                 wher

X++ Job to update worker contact information by excel upload

Upload a excel file to update the already existing Worker contact information HR/Common/Workers/List Edit/Profile->Contact Information. Note: In the Excel file all the columns should be formatted as Text and the fields should be given according to below header format. PersonnelNumber, contactdescription, contacttype,contact,contactext,primarycontact,privatecontact 123,abc, email address, abcxyz@blogger.com, ,yes,no static void EmployeeContactInfo(Args _args) {     SysExcelApplication application;     SysExcelWorkbooks workbooks;     SysExcelWorkbook workbook;     SysExcelWorksheets worksheets;     SysExcelWorksheet worksheet;     SysExcelCells cells;     COMVariantType type;     System.DateTime ShlefDate;     FilenameOpen filename,filenameopen;     dialogField dialogFilename;     Dialog dialog;     LogisticsLocation logisticsLocation   ;     LogisticsElectronicAddress logisticsElectronicAddress;     DirPartyLocation dirPartyLocation;     HcmWorker hcmWorke