static void Main(string[] args) { string customer = "US-004"; AxdCustomer foundCustomer = null; CallContext context = new CallContext(); context.Company = "USMF"; // CON_ReadCustomer.Con_ReadCustomerServiceReference.CustomerService proxy = new CON_ReadCustomer.Con_ReadCustomerServiceReference.CustomerService(); CustomerServiceClient proxy = new CustomerServiceClient(); try { foundCustomer = proxy.read(context, Program.readCritera(customer)); Console.WriteLine("AccountNum : " + foundCustomer.CustTable[0].AccountNum); Console.WriteLine("CustGroup : " + foundCustomer.CustTable[0].CustGroup); Console.WriteLine("Name : " + foundCustomer.CustTable[0].Name); //Console.WriteLine("Name : " + foundCustomer.CustTable[0].Name); Console.ReadLine(); } catch (Exception e) { Console.WriteLine(e.Message); } public static EntityKey[] readCritera(string customerAccount) { AxdEntity_CustTable custTable = new AxdEntity_CustTable(); EntityKey[] entityKeyList = new EntityKey[1]; EntityKey key = new EntityKey(); KeyField[] keyFields = new KeyField[1]; KeyField keyField = new KeyField(); keyField.Field = "AccountNum"; keyField.Value = customerAccount; keyFields[0] = keyField; key.KeyData = keyFields; entityKeyList[0] = key; return entityKeyList; } }
Friday, 21 November 2014
Reading Customer from C# AIF Service Ax 2012
Subscribe to:
Post Comments (Atom)
Best Practices for Troubleshooting Application Issues in D365 and Power Platform
When facing application issues, it’s important to systematically troubleshoot before reaching out for support. Follow these steps to ensure...
-
You may face this error when importing data through data entities and this mostly because of the index of the staging table. The data in you...
-
I was supposed to create a delivery schedule for purchase lines via code and I created this job from the form, how the delivery schedule lin...
Just what I needed. Thank you
ReplyDelete