1 public int monthDiff(date _start, date _end) 2 { 3 int diff; 4 int startYear, startMonth; 5 int endYear, endMonth; 6 ; 7 startYear = year(_start); 8 startMonth = mthofyr(_start); 9 endYear = year(_end);10 endMonth = mthofyr(_end);11 //year12 //endYear... Read More
Job:1 static void testDialogJob(Args _args)2 {3 testDialogClass testDialogClass ;4 ;5 testDialogClass = new testDialogClass() ;6 info(testDialogClass.mystr()) ;7 }Class: 1 class testDialogClass 2 { 3 str mystr ; 4 } 5 void new() 6 { 7 Args args = new Args(); 8 FormRun fo... Read More
Here is a sample class which is called via Dialog framework to create & post free text invoice using X++ code. 1 public void xtest() 2 { 3 Dialog dialog; 4 DialogField dlgCustAcc; 5 DialogGroup dialogPeriodLengthGroup, dialogPeriodLengthGroup1; 6 DialogField dlgLedgerAcc... Read More
今天我向大家介绍一种方法,用X++写一个方法就可以完成上述功能。1、在窗体下写下如下两个方法: 1 1、 2 3 public void gotoMainTable(Object ctrl, boolean isParmObject=false, container refFrom=connull()) 4 { 5 TableName tableName; 6 FormName formName; 7 int tableID; 8 int fieldID; 9 int ... Read More
1 UserGroupList UserGroupList;2 ;3 while select UserGroupList where UserGroupList.userId == curuserid()4 {5 info(UserGroupList.groupId);6 } Read More
1 Void click() 2 { 3 InventDim inventDim; 4 InventSum inventSum; 5 InventQty inventQty; 6 itemID YourItemID; 7 ; 8 YourItemID = 'YourItemID'; 9 while select sum(postedQty), sum(received), sum(deducted), sum(registered), sum(picked), sum(reservPhysical)10 from ... Read More
1 void saveimage()2 {3 image MyImage = new image();4 str 260 imgPath = EAMParameters::filePath();//从companyinfo表得到路径,页可以自定义你自己的路径5 ;6 MyImage.saveImage(imgPath + filename, ImageSaveType::BMP_UNCOMP);//filename是新的文件名7 } Read More
1 static void jobMain(Args _args) 2 { 3 treeNode treeNode; 4 xInfo xInfo = new xInfo(); 5 ; 6 treeNode = xInfo.rootNode(); 7 treeNode = treeNode::findNode("jobs").AOTfindChild("Job1"); 8 treeNode.AOTrun(); 9 treeNode = treeNode::findNode("jobs").AOTfindChild("Job2& Read More
1、找到 class EditorScripts。2、比如在右键增加AddDeveloperName菜单,当点击此菜单时,在当前行增加开发人员的名字。 1 void AddDeveloperName(Editor e) 2 { 3 int startLine = e.selectionStartLine(); 4 int startCol = e.selectionStartCol(); 5 ; 6 e.unmark(); 7 e.gotoLine(startLine); 8 e.gotoCol(startCol); 9 e.insertL... Read More
对于数组类型的字段,比如Dimension,假如你试图访问一个单独的数据,我们就不能直接使用Dimension[Index]的方式,否则我们将会的到类似"Query extended range failure: Right parenthesis expected near pos 0."的错误。下面的代码展示了怎样使用正确的方法访问数组类型Department。public void init(){ QueryBuildRange qbrDimension; ; super(); //Department's index is 1 ... Read More