Skip to main content

Posts

Showing posts with the label items

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;     ...

Importing Customers, Vendors and Products in AX 2012

This calls the vendor service: using System; using System.Collections.Generic; using System.Linq; using System.Text; using ConsoleApplication9.Vendors; namespace ConsoleApplication9 {     class Program     {         static void Main(string[] args)         {             VendTableServiceClient proxy = new VendTableServiceClient();             CallContext context = new CallContext();            context.Company = "ceu";  //New class that replaces AX endpoints.  It makes it obvious which company you are importing data into.  I love this class!!              AxdVendTable vendor = new AxdVendTable();      ...

rename items quickly

Here is a little script to rename items quickly. Just provide a CSV file with old and new item number. I found that making the CSV file was faster than making a job to intelligently rename items because I could use Excel functions and review the new item numbers faster static void renameFromCSV(Args _args) { #File CommaIO file; Container values; Dialog dialog; DialogField dfFileName; LineNum lineNum; ItemID itemIDfrom; ItemID itemIDto; InventTable inventTable; ; setPrefix(funcName()); dialog = new Dialog("Rename items"); dialog.filenameLookupFilter(["@SYS39829", #AllFilesName + #csv]); dfFileName = dialog.addField(typeid(FileNameOpen)); if (!dialog.run() || !dfFileName.value()) return; if (!WinAPI::fileExists(dfFileName.value())) throw error(strfmt("@S...