Skip to main content

Posts

Showing posts with the label Import

Importing Products into AX 2012

EcoResProductServiceClient service = new EcoResProductServiceClient();             CallContext ctx = new CallContext();             ctx.Company = "ceu";             AxdEcoResProduct axdProduct = new AxdEcoResProduct();                         //first, create a distinct product             AxdEntity_Product_EcoResDistinctProduct distinctProduct = new AxdEntity_Product_EcoResDistinctProduct();             distinctProduct.DisplayProductNumber = "Bulb60W";             distinctProduct.ProductType = AxdEnum_EcoResProductType.Item;     ...

Export and import Dynamics Ax labels

static void ExportLabels(Args _args) { str module = "TUS"; str exportFile = "\\\\tsclient\\c\\fil1.txt"; Label l; str s; int i; System.IO.TextWriter tw; ; l = new Label(); i = 0; tw = new System.IO.StreamWriter(exportFile); while(i < 9999) { s = l.extractString("@" + module + int2str(i)); if(substr(s,1,1) != '@') tw.WriteLine("@" + module + int2str(i) + ";" + s); i++; } tw.Close(); } static void ImportLabels(Args _args) { str module = "TUS"; str importFile = "\\\\tsclient\\c\\fil2.txt"; Label l; str s; System.IO.TextReader tw; System.String ss; str labelid, labeltext; int i; str existingLabel; ; l = new Label(); tw = new System.IO.StreamReader(importFile); ss = tw.ReadLine(); while(ss) { s = ss; i = strScan(s, ";", 1, 10); ...

Inventory Journal Import

1. Create a Movement Journal and go into the Lines screen. 2. Select Functions, Import Lines 3. Select a csv file with the columns: ItemId, Warehouse, Location, Batch, Qty, Cost. (you can mod the code to expand this) 4. The lines are added to the journal. You can download the xpo below, and here are some of the key bits of code. Create a class (mine is called inventJournalImport) extending runbase. Create a menu item (action) for the class and drop it on the InventJournalMovement form. The main method of the class is as follows: client static void main(Args args) { inventJournalImport inventJournalImport; Object formRunObject; JournalForm journalForm; InventJournalId inventJournalId; FormDataSource journalTrans_ds; ; inventJournalImport = new inventJournalImport(); inventJournalImport.getLast(); if (!args || !args.caller() || args.caller().name() != fo...