Posts

X++ Look ups - Existing form as a field lookup in another form

Option 1: A new field is added and that should show an already created form as its lookup. Create a new form with datasources and design. In design properties give window type = content page, style - lookup In the main form to get existing form as lookup, create a new form control and override lookup method as below. public void lookup() {    SysTableLookup          sysTableLookup ;     Query                   query           = new Query();     QueryBuildDataSource    queryBuildDataSource;     QueryBuildRange         queryBuildRange;     DimensionValue  value;     Args args;     FormRun formRun;     ;     args = new Args();     args.name("HcmWorkerEligibleLookup");     args.record(PurchReqTable);     args.parmEnum(NoYes::Yes); //     args.caller(this); //     formRun = classFactory.formRunClass(args);     formRun.init();     formRun.run();     formRun.detach();     this.performFormLookup(formRun); } In the main form init method, add below cod

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

AX 2012 X++ form splitter

class declaration of form public class FormRun extends ObjectRun {    SysFormSplitter_Y formSplitter_Y;//splitter moves in y- axis and it is vertical splitter container    SysFormSplitter_X formSplitter_X; //splitter moves in x- axis and it is horizontal splitter container } InIt method of form public void init() {     super();     formSplitter_Y = new SysFormSplitter_Y(Splittergroupname,top or bottom group name,this/element); formSplitter_X = new SysFormSplitter_X(Splitter,top,element);//splitter moves in x-axis when u take two tabs side by side } In design column property given as 2 to split the form to two section Override below methods in the splitter group control for moving splitter mouse up(override method) public int mouseUp(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift) {     int ret;     ret = super(_x, _y, _button, _Ctrl, _Shift);     return ret; } mousedown public int mouseDown(int _x, int _y, int _butt