Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. // Connect to Acumatica
  2. context = new acumatica.Screen();
  3. context.CookieContainer = new System.Net.CookieContainer();
  4. context.AllowAutoRedirect = true;
  5. context.EnableDecompression = true;
  6. context.Timeout = 1000000;
  7. context.Url = Properties.Settings.Default.WebServiceURL;
  8. LoginResult result = api.context.Login(Properties.Settings.Default.AcumaticaUserName, Properties.Settings.Default.AcumaticaPassword);
  9.  
  10. context.AR303010Clear();
  11. AR303010Content AR303010 = context.AR303010GetSchema();
  12.  
  13. try
  14. {
  15. Debug.WriteLine("--- Payment Method Start ---");
  16. // Create Invoice
  17. AR303010.Actions.Save.Commit = true;
  18. AR303010Content[] AR303010Content = context.AR303010Submit
  19. (
  20. new Command[]
  21. {
  22.  
  23. new Value { Value = "ABARTENDE", LinkedCommand = AR303010.PaymentMethodSelection.Customer, Commit = true },
  24.  
  25. AR303010.Actions.Insert,
  26.  
  27. new Value { Value = "VISA", LinkedCommand = AR303010.PaymentMethodSelection.PaymentMethod, Commit = true },
  28.  
  29. new Key
  30. {
  31. ObjectName = AR303010.PaymentMethodDetails.Description.ObjectName,
  32. FieldName = AR303010.PaymentMethodDetails.Description.FieldName,
  33. Value = "=[" + AR303010.PaymentMethodDetails.Description.ObjectName + "." + AR303010.PaymentMethodDetails.Description.FieldName + "]"
  34. },
  35.  
  36. new Value {Value = "Card Number", LinkedCommand = AR303010.PaymentMethodDetails.Description},
  37. new Value {Value = "4000000000003636", LinkedCommand = AR303010.PaymentMethodDetails.Value, Commit = true},
  38.  
  39. new Key
  40. {
  41. ObjectName = AR303010.PaymentMethodDetails.Description.ObjectName,
  42. FieldName = AR303010.PaymentMethodDetails.Description.FieldName,
  43. Value = "=[" + AR303010.PaymentMethodDetails.Description.ObjectName + "." + AR303010.PaymentMethodDetails.Description.FieldName + "]"
  44. },
  45.  
  46. new Value {Value = "Card Verification Code", LinkedCommand = AR303010.PaymentMethodDetails.Description},
  47. new Value {Value = "321", LinkedCommand = AR303010.PaymentMethodDetails.Value, Commit = true},
  48.  
  49. new Key
  50. {
  51. ObjectName = AR303010.PaymentMethodDetails.Description.ObjectName,
  52. FieldName = AR303010.PaymentMethodDetails.Description.FieldName,
  53. Value = "=[" + AR303010.PaymentMethodDetails.Description.ObjectName + "." + AR303010.PaymentMethodDetails.Description.FieldName + "]"
  54. },
  55.  
  56. new Value {Value = "Expiration Date", LinkedCommand = AR303010.PaymentMethodDetails.Description},
  57. new Value {Value = "012015", LinkedCommand = AR303010.PaymentMethodDetails.Value, Commit = true},
  58.  
  59. AR303010.Actions.Save
  60. }
  61. );
  62.  
  63. Debug.WriteLine("--- Payment Method Created ---");
  64. }
  65. catch (Exception ex)
  66. {
  67. Debug.WriteLine(" --- Failed to create Payment Method ---");
  68. Debug.WriteLine(ex.Message);
  69. }
  70.  
  71. Error #12: Inserting 'Customer Payment Method Detail' record raised one or more errors. Please review. Error: 'Value' may not be empty. ---> PX.Data.PXOuterException: Error #12: Inserting 'Customer Payment Method Detail' record raised one or more errors. Please review.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement