Ideas to implement an Order Change Log

I’m not at my computer, but in the menu items at the top of the customization editor, there is an option I think called customization wizards. When you open that there is a menu that let’s you choose what you want to do. Add UD table as a child is one of the options (other options include extended properties I think). Then you pick what you want your keys to be. It’s all based on the views that are in the screen you are customizing. So on your case order entry.

What about a UD reason field that is captured in the built in change log. The field is cleared on a post process order update directive. You could add custom validation that the field needs a reason after a user changes certain fields.

Found it. I was looking at the Wizards Tab vs the Tools->Wizards Menu. Thanks

1 Like

While I appreciate everyone’s thoughts on this…I truly believe an over-engineered solution is being pushed here. The solution being proposed is more time consuming for the end users to enter the data accurately, and they may not like needing to navigate to an extra screen. Why not use automation and make their job a little easier too? While I don’t have 20 min right now to whip up a demo of what I am thinking, I can give a high level overview.

  1. Add a “Reason” field on the order entry screen tied to a ud field (we will validate off this to ensure users enter a reason)
  2. Include the reason field, and whatever fields you want to monitor in the change log on the order head and dtl data directives
  3. Add validation that the reason field is populated with data using a method directive on the change existing order business object
  4. Clear the reason field after an update using c#

Simple. Elegant. Effective. The reasons will be captured by the change log and whichever fields you want to monitor automatically. 1. You will make their job easier with less data entry 2. You will have more accurate data (you could even use UD codes for reasons so that reasons are consistent) and 3. You look like a superstar :wink:

1 Like

Elegant until you realize you are storing a numeric value someone wants to report on in the middle of one long text field that is tracking all your changes. They would go back to the spreadsheet a week later when they try to add up the changes on an order.

1 Like

Testing adding the UD Table as a child. Does this wizard actually work? I have added the table and linked a couple fields, the code gets generated. I have yet to compile it as the errors are endless.

I was able to do it without much hassle. You are on the order entry screen?

edit
I tried it and it worked just fine. Added Key1 and Key2 as OrderNum and OrderLine. It finished, now compile errors. What are some of the errors that you are seeing?

We are on different versions though, so maybe there has been some work done on it.

Yes, Order Entry screen and OrderNum and OrderLine fields added.

from the EUG website

Okay, so a search of Epicare’s sup[port KB revealed KB0030682 which basically says that in order to actually do this you have to match up the first 4 UD Key fields with something, otherwise there is nothing to return with a vague reference to possibly handling missing keys better in the future.

To fix it, he just used duplicate values for the keys he didn’t need. (so make both Key3 and Key4 orderline or something)

Obviously it’s been fixed in future versions. That user was on 10.2.100

And his would compile and was on a different screen, so it may not be the same problem.

I added Company, OrderNum, OrderLine and PartNum to use up all four fields. Still won’t compile.

Can you paste the list of errors in here? And did you start with a blank customization? (had to ask)

Compiling Custom Code …

----------errors------------

Error: CS0103 - line 75 (1873) - The name ‘InitializeUD01Adapter’ does not exist in the current context
Error: CS1061 - line 81 (1879) - ‘Script’ does not contain a definition for ‘baseToolbarsManager_ToolClickForUD01’ and no extension method ‘baseToolbarsManager_ToolClickForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 82 (1880) - ‘Script’ does not contain a definition for ‘SalesOrderForm_BeforeToolClickForUD01’ and no extension method ‘SalesOrderForm_BeforeToolClickForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 83 (1881) - ‘Script’ does not contain a definition for ‘SalesOrderForm_AfterToolClickForUD01’ and no extension method ‘SalesOrderForm_AfterToolClickForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 84 (1882) - ‘Script’ does not contain a definition for ‘OrderDtl_AfterRowChangeForUD01’ and no extension method ‘OrderDtl_AfterRowChangeForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 86 (1884) - ‘Script’ does not contain a definition for ‘OrderDtl_DataView_ListChangedForUD01’ and no extension method ‘OrderDtl_DataView_ListChangedForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 116 (1914) - ‘Script’ does not contain a definition for ‘baseToolbarsManager_ToolClickForUD01’ and no extension method ‘baseToolbarsManager_ToolClickForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 117 (1915) - ‘Script’ does not contain a definition for ‘SalesOrderForm_BeforeToolClickForUD01’ and no extension method ‘SalesOrderForm_BeforeToolClickForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 118 (1916) - ‘Script’ does not contain a definition for ‘SalesOrderForm_AfterToolClickForUD01’ and no extension method ‘SalesOrderForm_AfterToolClickForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 119 (1917) - ‘Script’ does not contain a definition for ‘OrderDtl_AfterRowChangeForUD01’ and no extension method ‘OrderDtl_AfterRowChangeForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 120 (1918) - ‘Script’ does not contain a definition for ‘OrderDtl_DataView_ListChangedForUD01’ and no extension method ‘OrderDtl_DataView_ListChangedForUD01’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1245 (3043) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1245 (3043) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1246 (3044) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1250 (3048) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1251 (3049) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1251 (3049) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1252 (3050) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1253 (3051) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1254 (3052) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1256 (3054) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1256 (3054) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1260 (3058) - ‘frmProc’ does not contain a definition for ‘UD01_Column’ and no extension method ‘UD01_Column’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1260 (3058) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1263 (3061) - ‘frmProc’ does not contain a definition for ‘_edvOrderDtl’ and no extension method ‘_edvOrderDtl’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1263 (3061) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1276 (3074) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1276 (3074) - ‘frmProc’ does not contain a definition for ‘_edvOrderDtl’ and no extension method ‘_edvOrderDtl’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1278 (3076) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1287 (3085) - ‘frmProc’ does not contain a definition for ‘_Key1UD01’ and no extension method ‘_Key1UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1287 (3085) - ‘frmProc’ does not contain a definition for ‘_Key2UD01’ and no extension method ‘_Key2UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1287 (3085) - ‘frmProc’ does not contain a definition for ‘_Key3UD01’ and no extension method ‘_Key3UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1287 (3085) - ‘frmProc’ does not contain a definition for ‘_Key4UD01’ and no extension method ‘_Key4UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1287 (3085) - ‘frmProc’ does not contain a definition for ‘_Key5UD01’ and no extension method ‘_Key5UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1296 (3094) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1298 (3096) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1300 (3098) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1303 (3101) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1307 (3105) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1307 (3105) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1307 (3105) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1307 (3105) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1310 (3108) - ‘frmProc’ does not contain a definition for ‘_Key1UD01’ and no extension method ‘_Key1UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1311 (3109) - ‘frmProc’ does not contain a definition for ‘_Key2UD01’ and no extension method ‘_Key2UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1312 (3110) - ‘frmProc’ does not contain a definition for ‘_Key3UD01’ and no extension method ‘_Key3UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1313 (3111) - ‘frmProc’ does not contain a definition for ‘_Key4UD01’ and no extension method ‘_Key4UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1314 (3112) - ‘frmProc’ does not contain a definition for ‘_Key5UD01’ and no extension method ‘_Key5UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1320 (3118) - ‘frmProc’ does not contain a definition for ‘_edvOrderDtl’ and no extension method ‘_edvOrderDtl’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1326 (3124) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1334 (3132) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1340 (3138) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1351 (3149) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1361 (3159) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1361 (3159) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1361 (3159) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1368 (3166) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1375 (3173) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1378 (3176) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1391 (3189) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1391 (3189) - ‘frmProc’ does not contain a definition for ‘_Key1UD01’ and no extension method ‘_Key1UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1391 (3189) - ‘frmProc’ does not contain a definition for ‘_Key2UD01’ and no extension method ‘_Key2UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1391 (3189) - ‘frmProc’ does not contain a definition for ‘_Key3UD01’ and no extension method ‘_Key3UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1391 (3189) - ‘frmProc’ does not contain a definition for ‘_Key4UD01’ and no extension method ‘_Key4UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1394 (3192) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1398 (3196) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1398 (3196) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1400 (3198) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1402 (3200) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1402 (3200) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1405 (3203) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS0103 - line 1407 (3205) - The name ‘_edvUD01’ does not exist in the current context
Error: CS0103 - line 1409 (3207) - The name ‘_edvUD01’ does not exist in the current context
Error: CS0103 - line 1409 (3207) - The name ‘_edvUD01’ does not exist in the current context
Error: CS1061 - line 1413 (3211) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1413 (3211) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1413 (3211) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1413 (3211) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1423 (3221) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1426 (3224) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1426 (3224) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1426 (3224) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1426 (3224) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1431 (3229) - ‘frmProc’ does not contain a definition for ‘_Key1UD01’ and no extension method ‘_Key1UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1432 (3230) - ‘frmProc’ does not contain a definition for ‘_Key2UD01’ and no extension method ‘_Key2UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1433 (3231) - ‘frmProc’ does not contain a definition for ‘_Key3UD01’ and no extension method ‘_Key3UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1434 (3232) - ‘frmProc’ does not contain a definition for ‘_Key4UD01’ and no extension method ‘_Key4UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1435 (3233) - ‘frmProc’ does not contain a definition for ‘_Key5UD01’ and no extension method ‘_Key5UD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1437 (3235) - ‘frmProc’ does not contain a definition for ‘_ud01Adapter’ and no extension method ‘_ud01Adapter’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1440 (3238) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1440 (3238) - ‘frmProc’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1440 (3238) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 1440 (3238) - ‘frmProc’ does not contain a definition for ‘_edvUD01’ and no extension method ‘_edvUD01’ accepting a first argument of type ‘frmProc’ could be found (are you missing a using directive or an assembly reference?)
Error: CS0103 - line 1500 (3298) - The name ‘OrderDtl_DataView’ does not exist in the current context
Error: CS0103 - line 1501 (3299) - The name ‘OrderDtl_DataView’ does not exist in the current context
Error: CS0103 - line 1502 (3300) - The name ‘OrderDtl_DataView’ does not exist in the current context
Error: CS0103 - line 1503 (3301) - The name ‘OrderDtl_DataView’ does not exist in the current context

** Compile Failed. **

Can you past in your code? Just do the whole script editor.

From my first look, it looks to me like you are missing using Ice.Adapters. But that should already be in there.:thinking:

// **************************************************
// Custom code for SalesOrderForm
// Created: 6/19/2017 11:45:29 AM
// **************************************************


using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using Infragistics.Win.UltraWinToolbars;
using System.IO;
using Erp.BO;
using Ice.Proxy.Lib;
using System.Collections.Generic;
//using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Serialization;

public class Script
{
	// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
	// Begin Wizard Added Module Level Variables **

	private EpiDataView edvOrderHed;
	private UD01Adapter _ud01Adapter;
	private EpiDataView _edvOrderDtl;
	private DataTable UD01_Column;
	private EpiDataView _edvUD01;
	private string _Key1UD01;
	private string _Key2UD01;
	private string _Key3UD01;
	private string _Key4UD01;
	private string _Key5UD01;
	private DataView OrderDtl_DataView;
	// End Wizard Added Module Level Variables **

	// Add Custom Module Level Variables Here **
	static  ButtonTool btnImportXmlData =  null;
	string  xmlFile="";
	List<string> invalidPartsList;
    List<string> invalidMaterialsList;
    List<string> invalidOperationsList;
	List<string> invalidCurrencyList;


	bool flag = false;
	

	XmlSerializer serializer;
	
	AssemblyList assemblyList;

	Thread thProgress;
	frmProc processForm;
	BAQDataView edvCompany;
	public void InitializeCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		// Begin Wizard Added Variable Initialization

		this.edvOrderHed = ((EpiDataView)(this.oTrans.EpiDataViews["OrderHed"]));
		this.edvOrderHed.EpiViewNotification += new EpiViewNotification(this.edvOrderHed_EpiViewNotification);
		InitializeUD01Adapter();
		this._Key1UD01 = string.Empty;
		this._Key2UD01 = string.Empty;
		this._Key3UD01 = string.Empty;
		this._Key4UD01 = string.Empty;
		this._Key5UD01 = string.Empty;
		this.baseToolbarsManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.baseToolbarsManager_ToolClickForUD01);
		this.SalesOrderForm.BeforeToolClick += new Ice.Lib.Framework.BeforeToolClickEventHandler(this.SalesOrderForm_BeforeToolClickForUD01);
		this.SalesOrderForm.AfterToolClick += new Ice.Lib.Framework.AfterToolClickEventHandler(this.SalesOrderForm_AfterToolClickForUD01);
		this.OrderDtl_Row.EpiRowChanged += new EpiRowChanged(this.OrderDtl_AfterRowChangeForUD01);
		this.OrderDtl_DataView = this.OrderDtl_Row.dataView;
		this.OrderDtl_DataView.ListChanged += new ListChangedEventHandler(this.OrderDtl_DataView_ListChangedForUD01);
		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		// End Wizard Added Custom Method Calls
		
		CreateBAQView();
	}

	public void DestroyCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		// Begin Wizard Added Object Disposal

		this.edvOrderHed.EpiViewNotification -= new EpiViewNotification(this.edvOrderHed_EpiViewNotification);
		this.edvOrderHed = null;
		if ((this._ud01Adapter != null))
		{
			this._ud01Adapter.Dispose();
			this._ud01Adapter = null;
		}
		this._edvUD01 = null;
		this._edvOrderDtl = null;
		this.UD01_Column = null;
		this._Key1UD01 = null;
		this._Key2UD01 = null;
		this._Key3UD01 = null;
		this._Key4UD01 = null;
		this._Key5UD01 = null;
		this.baseToolbarsManager.ToolClick -= new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.baseToolbarsManager_ToolClickForUD01);
		this.SalesOrderForm.BeforeToolClick -= new Ice.Lib.Framework.BeforeToolClickEventHandler(this.SalesOrderForm_BeforeToolClickForUD01);
		this.SalesOrderForm.AfterToolClick -= new Ice.Lib.Framework.AfterToolClickEventHandler(this.SalesOrderForm_AfterToolClickForUD01);
		this.OrderDtl_Row.EpiRowChanged -= new EpiRowChanged(this.OrderDtl_AfterRowChangeForUD01);
		this.OrderDtl_DataView.ListChanged -= new ListChangedEventHandler(this.OrderDtl_DataView_ListChangedForUD01);
		this.OrderDtl_DataView = null;
		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal
		if(thProgress!=null && thProgress.IsAlive){
			processForm.Invoke(new Action(() =>
						{
						    processForm.Close();
							processForm.Dispose();
						}));
			thProgress =null;
		}
	}
	
	private void edvOrderHed_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
		// ** Argument Properties and Uses **
		// view.dataView[args.Row]["FieldName"]
		// args.Row, args.Column, args.Sender, args.NotifyType
		// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
		if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
		{
			if ((args.Row > -1))
			{
				PopupMenuTool actionMenu =(PopupMenuTool) SalesOrderForm.MainToolManager.Tools["ActionsMenu"];
				EpiDataView edvOH = oTrans.Factory("OrderHed");
				if (edvOH.Row >= 0)
				{
					if (string.IsNullOrEmpty((string)edvOH.dataView[edvOH.Row]["CustomerCustID"]))
					{
						if (actionMenu.Tools.Exists("ImportFansilQuote"))
						//actionMenu.Tools["ImportFansilQuote"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.True;
						actionMenu.Tools["ImportFansilQuote"].SharedProps.Enabled = false;
					}
					else
					{
						if (actionMenu.Tools.Exists("ImportFansilQuote"))
							//actionMenu.Tools["ImportFansilQuote"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.True;
							actionMenu.Tools["ImportFansilQuote"].SharedProps.Enabled = true;
					}
				}
			}
			else
			{
				PopupMenuTool actionMenu =(PopupMenuTool) SalesOrderForm.MainToolManager.Tools["ActionsMenu"];
				if (actionMenu.Tools.Exists("ImportFansilQuote"))
					//actionMenu.Tools["ImportFansilQuote"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False;
					actionMenu.Tools["ImportFansilQuote"].SharedProps.Enabled = false;
			}
		}
	}

	void CreateBAQView() {
	  // create the baq view and add it to the transaction
	  edvCompany = new BAQDataView("VAW_FanSilComsil");
	  oTrans.Add("VAW_FanSilComsil", edvCompany);
	  
	  // publish columns we'll bind to
	  var yearBinding = "OrderHed.Company";
	  
	  
	  oTrans.PublishColumnChange(yearBinding, "OrderHedCompanyPub");
	  
	  var yearPub = oTrans.GetPublisher(yearBinding);
	  
	  
	  // subscribe our BAQ view
	  // NOTE: In E10 field names use the format with an underscore. <Table.Field> will no longer work.
	  edvCompany.SubscribeToPublisher(yearPub.PublishName, "SysCompany_Company");
	  
	}

	private void ResetThread()
	{
		thProgress = null;
		thProgress = new Thread(ShowProgressForm);
	}
	private void ShowProgressForm()
	{
		processForm = new frmProc();
		processForm.ShowDialog();
	}
	private void SalesOrderForm_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
		//Get a Handle on the Main Tool Manager for the form

		if(SalesOrderForm.MainToolManager==null || SalesOrderForm.MainToolManager.Tools.Exists("ImportFansilQuote") )
			return;
		
		// Instantiate a new button which  will  execute  the Import routine

		PopupMenuTool actionMenu =(PopupMenuTool) SalesOrderForm.MainToolManager.Tools["ActionsMenu"];
		btnImportXmlData =  new  ButtonTool("ImportFansilQuote");
		btnImportXmlData.CustomizedCaption = "Import Fansil / Comsil";
		
		//Add click handler

		btnImportXmlData.ToolClick  += new   ToolClickEventHandler(btnImportXmlData_ToolClick);

		// Add to Main Tool Manager
		SalesOrderForm.MainToolManager.Tools.Add(btnImportXmlData);
		
		// Add below the "Action" menu 
		actionMenu.Tools.Add(btnImportXmlData);
		//actionMenu.Tools["ImportFansilQuote"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False;
		actionMenu.Tools["ImportFansilQuote"].SharedProps.Enabled = false;
		SalesOrderForm.setToolImage(actionMenu.Tools["ImportFansilQuote"],"MenuProcess");
	}

	private  void  btnImportXmlData_ToolClick(object sender, ToolClickEventArgs e )
	{
		try
        {
			EpiDataView edvSalesOrder = oTrans.Factory("OrderHed");
			int rowIndex = edvSalesOrder.Row;	
			if(rowIndex >= 0)
			{
				oTrans.PushStatusText("Processing Fansil / Comsil Import",true);
	            XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(AssemblyList));
	            StreamReader reader = new StreamReader(edvCompany.dataView[edvCompany.Row]["SysCompany_VAWImportLocation_c"].ToString());
	            assemblyList = (AssemblyList)serializer.Deserialize(reader);
	            reader.Close();
				reader.Dispose();
	
	            SalesOrderAdapter salesOrderAdapter = new SalesOrderAdapter(oTrans); 
				salesOrderAdapter.BOConnect();
				ResetThread();
				thProgress.Start();
	
	            
	            EpiDataView edvOrderDtl = oTrans.Factory("OrderDtl");
	
	            EpiDataView callContextClientDV = oTrans.Factory("CallContextClientData");
	            string currentPlant = callContextClientDV.dataView[callContextClientDV.Row]["CurrentPlant"].ToString();
	
	            int orderLines = edvOrderDtl.dataView.Count;
	            
				
	            if (rowIndex >= 0 && oTrans.Update())
	            {
					
	                int orderNumber = (int)edvSalesOrder.dataView[edvSalesOrder.Row]["OrderNum"];
					
	                if (orderNumber > 0)
	                {
						salesOrderAdapter.GetByID(orderNumber);
						string currencyCode = salesOrderAdapter.SalesOrderData.OrderHed[salesOrderAdapter.SalesOrderData.OrderHed.Count - 1].CurrencyCode;
	
	                    BOReaderImpl boReader = WCFServiceSupport.CreateImpl<Ice.Proxy.Lib.BOReaderImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BOReaderSvcContract>.UriPath);
	                    DataSet dsValidator = new DataSet();
						invalidPartsList = new List<string>();
	                    invalidMaterialsList = new List<string>();
	                    invalidOperationsList = new List<string>();
						invalidCurrencyList =  new  List<string> ();
						var notmatchingCurrencyList = new List<string>();
	                    foreach (AssemblyListAssembly partsList in assemblyList.Assembly)
	                    {
	                        dsValidator = boReader.GetList("Erp:BO:Part", "PartNum ='" + partsList.HeaderInfo.PartNo + "'", "PartNum");
	
	                        if (!(dsValidator.Tables[0].Rows.Count > 0))
	                        {
	                            invalidPartsList.Add(partsList.HeaderInfo.PartNo);
	                        }
	
							
							if (partsList.HeaderInfo.Currency!=null && !string.IsNullOrEmpty(partsList.HeaderInfo.Currency)){
								dsValidator = boReader.GetList("Erp:BO:Currency", "CurrencyCode='"+ partsList.HeaderInfo.Currency +"'", "CurrencyCode");
		   					 if (!(dsValidator.Tables[0].Rows.Count > 0))
	                        	{
									invalidCurrencyList.Add(partsList.HeaderInfo.Currency);
								}
							}
							if (partsList.HeaderInfo.Currency!=null && !(currencyCode.Equals(partsList.HeaderInfo.Currency)))
	                        {
	                            notmatchingCurrencyList.Add(partsList.HeaderInfo.Currency);
	                        }
	                        foreach (AssemblyListAssemblyMaterial materialList in partsList.MaterialList)
	                        {
	                            dsValidator = boReader.GetList("Erp:BO:Part", "PartNum ='" + materialList.PartNo + "'", "PartNum");
	
	                            if (!(dsValidator.Tables[0].Rows.Count > 0))
	                            {
	                                invalidMaterialsList.Add(materialList.PartNo);
	                            }
	                        }
	
	                        foreach (AssemblyListAssemblyOperation operationList in partsList.OperationList)
	                        {
	                            dsValidator = boReader.GetList("Erp:BO:OpMaster", "OpCode ='" + operationList.OperationCode + "'", "OpCode");
	
	                            if (!(dsValidator.Tables[0].Rows.Count > 0))
	                            {
	                                invalidOperationsList.Add(operationList.OperationCode);
	                            }
	                        }
	                    }
	
	                    if (invalidPartsList.Count > 0 || invalidMaterialsList.Count > 0 || invalidOperationsList.Count > 0  || invalidCurrencyList.Count > 0)
	                    {
	                        string exceptionMessage = "The following information does not exist in Epicor\r\n\r\n";
	
							if(invalidCurrencyList.Count > 0)
							{
								exceptionMessage += "Currency:" + Environment.NewLine;
								
		                        foreach (string invalidCurrency in invalidCurrencyList)
		                        {
		                            exceptionMessage += invalidCurrency + "\r\n";
		                        }
								exceptionMessage += "\r\n";
							}
	
							if(invalidPartsList.Count > 0)
							{								
								exceptionMessage +="Parts:" + Environment.NewLine;
								
		                        foreach (string invalidPart in invalidPartsList)
		                        {
		                            exceptionMessage += invalidPart + "\r\n";
		                        }
								exceptionMessage += "\r\n";
							}
	
							if(invalidMaterialsList.Count > 0)
							{
		                        exceptionMessage += "Materials:" + Environment.NewLine;
		
		                        foreach (string invalidMaterial in invalidMaterialsList)
		                        {
		                            exceptionMessage += invalidMaterial + "\r\n";
		                        }
								exceptionMessage += "\r\n";
							}
	
							if(invalidOperationsList.Count > 0)
							{
		                        exceptionMessage += "Operations:" + Environment.NewLine;
		
		                        foreach (string invalidOperation in invalidOperationsList)
		                        {
		                            exceptionMessage += invalidOperation + "\r\n";
		                        }
								exceptionMessage += "\r\n";
							}
	
							exceptionMessage += "For assistance with this error, please share this\r\nmessage with VAW’s software developers.\r\n";
							processForm.Invoke(new Action(() =>
							{
							    processForm.Close();
								processForm.Dispose();
							}));
	                        MessageBox.Show(exceptionMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
														
	                        return;
	                    }
						
						if (notmatchingCurrencyList.Count > 0)
	                    {
	                        string exceptionMessage = "Fansil / Comsil currency does not match Epicor's.\r\n\r\n";
	
							exceptionMessage += "Please change the currency in Fansil / Comsil to match Epicor's and try again.\r\n";
									
							processForm.Invoke(new Action(() =>
							{
							    processForm.Close();
								processForm.Dispose();
							}));
	                        MessageBox.Show(exceptionMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);							
							
	                        return;
						}	
	                    							
	                    //Implements  the logic  to validate the lines numbers
	                    if (orderLines > 0)
	                    {
							processForm.Invoke(new Action(() =>
							{
							    processForm.Close();
								processForm.Dispose();
							}));
							SalesOrderForm.Focus();
	                        string message = "This Sales Order contains (" + orderLines.ToString() + ") existing lines.\r\n\r\n- To append new lines \t(Click Yes) \r\n- To replace all lines   \t(Click No) \r\n- To cancel the import \t(Click Cancel)";
	
	                        switch (MessageBox.Show(message, "Alert", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
	                        {
	                            case DialogResult.Yes:
									ResetThread();
									thProgress.Start();
	                                break;
	
	                            case DialogResult.No:
											{
												var jps = boReader.GetList("Erp:BO:JobProdSearch", "OrderNum =" + orderNumber, "JobNum");
												JobEntryAdapter jobEntryAdapter = new JobEntryAdapter(oTrans);
	            								jobEntryAdapter.BOConnect();
												ResetThread();
												thProgress.Start();
												foreach(DataRow dr in jps.Tables[0].Rows)
												{
													jobEntryAdapter.GetByID(dr[0].ToString());
													jobEntryAdapter.JobEntryData.JobProd[0].Delete();
													jobEntryAdapter.Update();
													jobEntryAdapter.DeleteByID(dr[0].ToString());
												}
												jobEntryAdapter.Dispose();
				                                foreach (SalesOrderDataSet.OrderDtlRow dr in salesOrderAdapter.salesOrderData.OrderDtl)
				                                {
				                                    dr.Delete();
				                                }
				                                salesOrderAdapter.Update();
				                                oTrans.Refresh();
									}
	                                break;
	
	                            case DialogResult.Cancel:
									;
									return;
	                        }
	                    }
	
						//
						CreateOrderLine(assemblyList, salesOrderAdapter, orderNumber, currentPlant);
						
	
	                }
	                else
	                {
	                    MessageBox.Show("Please select a valid order number","Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
	                }
	            }
	            else
	            {
	                MessageBox.Show("Please select a valid  order number","Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
	            }
			}
			else
			{
				MessageBox.Show("Please select a valid order number","Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
			}

        }
        catch (Exception ex)
        {
            MessageBox.Show("There was and error processing the file\r\nError: " + ex.Message,"Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
			
        }

		oTrans.PushStatusText("Ready...",false);
    }

	private void CreateOrderLine(AssemblyList assemblyList, SalesOrderAdapter salesOrderAdapter,int orderNumber, string currentPlant)
    {
        try
        {
			int progressIndex= 1;
			int progressLength = assemblyList.Assembly.Length;

			
            //ChangePartNumMaster  variables
            string partNum;
			string partDesc;
            Boolean lSubstitutePartExist;
            Boolean lIsPhantom;
            String uomCode;
            String cDeleteComponentsMessage;
            String questionString;
            String cWarningMessage;
            Boolean multipleMatch;
            Boolean promptToExplodeBOM;
            String cConfigPartMessage;
            String cSubPartMessage;
            String explodeBOMerrMessage;
            String cMsgType;
            Boolean multiSubsAvail;
            Boolean runOutQtyAvail;

            //ChangeSellingQtyMaster variables
            int iOrderNum;
            bool lContinue;
            string cResponseMsg;
            string cCreditShipAction;
            string cDisplayMessage;
            string cCompliantMsg;
            string cResponseMsgOrdRel;

            //CheckComplianceOrderFail Variables
            string compliantMsg;

            //MasterUpdate variables
            decimal ipSellingQuantity;
            string pcPartNum;
            string pcDimCode;
            string pcMessage;
            string pcNeqQtyAction;
            string opWarningMsg;
            string cSellingQuantityChangeMsgText;
			 
            foreach (AssemblyListAssembly header in assemblyList.Assembly)
            {		

				salesOrderAdapter.ClearData();
                salesOrderAdapter.GetByID(orderNumber);

                // Setup  ChangePartNumMaster  variables
                partNum = header.HeaderInfo.PartNo;
				partDesc =  header.HeaderInfo.PartDescription;
                lSubstitutePartExist = false;
                lIsPhantom = false;
                uomCode = string.Empty;

                salesOrderAdapter.GetNewOrderDtl(orderNumber);

                salesOrderAdapter.ChangePartNumMaster(ref partNum, ref lSubstitutePartExist, ref lIsPhantom, ref uomCode,
                    Guid.Empty, "", false, false, false, true, true,
                    true, out cDeleteComponentsMessage, out questionString, out cWarningMessage, out multipleMatch,
                    out promptToExplodeBOM, out cConfigPartMessage, out cSubPartMessage, out explodeBOMerrMessage, out cMsgType, out multiSubsAvail,
                    out runOutQtyAvail);

                //Setup ChangeSellingQtyMaster variables
                ipSellingQuantity = header.HeaderInfo.OrderQuantity;
                pcPartNum = header.HeaderInfo.PartNo;
                pcDimCode = header.HeaderInfo.WeightUnits;

                salesOrderAdapter.ChangeSellingQtyMaster(ipSellingQuantity, false, false, true, true,
                    false, true, pcPartNum, "", "", "", pcDimCode, 0, out pcMessage, out pcNeqQtyAction, out opWarningMsg,
                    out cSellingQuantityChangeMsgText);

                //Setup MasterUpdate variables
                iOrderNum = orderNumber;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1]["Weight_c"] = header.HeaderInfo.UnitNetWeight;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1]["WeightUOM_c"] = header.HeaderInfo.WeightUnits;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1]["Length_c"] = header.HeaderInfo.UnitLength;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1]["Width_c"] = header.HeaderInfo.UnitWidth;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1]["Heigth_c"] = header.HeaderInfo.UnitHeight;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1]["DimensionUOM_c"] = header.HeaderInfo.LWHUnits;

				salesOrderAdapter.salesOrderData.OrderDtl[salesOrderAdapter.salesOrderData.OrderDtl.Count - 1].LineDesc = header.HeaderInfo.PartDescription;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].UnitPrice = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DocUnitPrice = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DocListPrice = header.HeaderInfo.UnitPrice;
				
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DocOrdBasedPrice = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].ExtPriceDtl = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DocExtPriceDtl = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DspUnitPrice = header.HeaderInfo.UnitPrice;
			
				

				salesOrderAdapter.ChangeUnitPrice();
               // salesOrderAdapter.MasterUpdate(true, true, "", 0,iOrderNum, true, out lContinue, out cResponseMsg, out cCreditShipAction,out cDisplayMessage, out cCompliantMsg, out cResponseMsgOrdRel);
				salesOrderAdapter.Update();
				
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].UnitPrice = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DocUnitPrice = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DocListPrice = header.HeaderInfo.UnitPrice;
				
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DocOrdBasedPrice = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].ExtPriceDtl = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DocExtPriceDtl = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DspUnitPrice = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.Update();
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].DocDspUnitPrice = header.HeaderInfo.UnitPrice;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].CurrencySwitch=false;
				salesOrderAdapter.SalesOrderData.OrderDtl[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].RowMod="U";
				salesOrderAdapter.ChangeUnitPrice();
				salesOrderAdapter.Update();
                DateTime newOrderDate = DateTime.Now.AddDays(30);
                string tableOrderHed = "OrderHed";
                string tableOrderRel = "OrderRel";

                /*salesOrderAdapter.salesOrderData.OrderHed[salesOrderAdapter.salesOrderData.OrderHed.Count - 1].NeedByDate = newOrderDate;
                salesOrderAdapter.salesOrderData.OrderHed[salesOrderAdapter.salesOrderData.OrderHed.Count - 1].RequestDate = newOrderDate;
                salesOrderAdapter.ChangeNeedByDate(tableOrderHed);
                salesOrderAdapter.Update();

                salesOrderAdapter.salesOrderData.OrderRel[salesOrderAdapter.salesOrderData.OrderRel.Count - 1].NeedByDate = salesOrderAdapter.salesOrderData.OrderHed[salesOrderAdapter.salesOrderData.OrderHed.Count - 1].NeedByDate;
                salesOrderAdapter.salesOrderData.OrderRel[salesOrderAdapter.salesOrderData.OrderRel.Count - 1].ReqDate = salesOrderAdapter.salesOrderData.OrderHed[salesOrderAdapter.salesOrderData.OrderHed.Count - 1].RequestDate;
                salesOrderAdapter.ChangeNeedByDate(tableOrderRel);*/
				
				if (!(header.HeaderInfo.IncludeMOM))
				{
					salesOrderAdapter.SalesOrderData.OrderRel[salesOrderAdapter.SalesOrderData.OrderDtl.Count - 1].RowMod="U";
					salesOrderAdapter.ChangeMake(false);
					salesOrderAdapter.ChangeOrderRelBuyToOrder(true);
					salesOrderAdapter.Update();
				}

				//Set up CheckComplianceOrderFail variables
				compliantMsg = string.Empty;

				salesOrderAdapter.CheckComplianceOrderFail(orderNumber, out compliantMsg);

				//Only create job if IncludeMOM selected
				if (header.HeaderInfo.IncludeMOM)
				{
					if (!(CreateJob(salesOrderAdapter, header, partNum, partDesc, currentPlant, orderNumber)))
					{
						flag = false;
					}
				}
				//else
				//{
				//    salesOrderAdapter.ChangeMake(false);
				//    salesOrderAdapter.ChangeOrderRelBuyToOrder(true);
				//}
				
				//Fill  the progressbar..
                
				decimal pct = (decimal)((decimal)progressIndex / (decimal)progressLength)*100m;
				processForm.BeginInvoke((MethodInvoker)delegate () { processForm.SetStatus(string.Format("Importing Lines / Creating Jobs...{0}%", Math.Round(pct,0))); });
                progressIndex++;					

            }
			
			oTrans.Refresh();			         
            flag = true;
			processForm.Invoke(new Action(() =>
			{
			    processForm.Close();
				processForm.Dispose();
			}));
        }
        catch (Exception ex)
        {
            MessageBox.Show("There was and error processing the file\r\nError:" + ex.Message, "Error");
            flag = false;
        }
    }

	private bool CreateJob(SalesOrderAdapter salesOrderAdapter, AssemblyListAssembly header, string partNum,string  partDesc, string currentPlant, int orderNumber)
    {
        try
        {
			JobEntryAdapter jobEntryAdapter = new JobEntryAdapter(oTrans);
            jobEntryAdapter.BOConnect();
			
            //JobEntry Variables
            string jobNumber;

            // jobEntryAdapter.CheckPrePartInfo variables
            bool skipXRefUpdate;
            string xrefPartNum;
            string xrefPartType;
            string vMsgText;
            bool vSubAvail;
            string vMsgType;
            Boolean multipleMatch;

            //jobEntryAdapter.ChangeJobMtlPartNum Variables

            string ipPartNum;
            bool opPartChgCompleted;
            string opMtlIssuedAction;

            //jobEntryAdapter.ChangeJobOperOpCode
            string proposedOpCode;
            string refreshMessage;

            //jobEntryAdapter.GetNewJobProd
            int orderLine;
            int orderRelNum;

            //Setup jobEntryAdapter.CheckPrePartInfo
            skipXRefUpdate = false;
            xrefPartNum = string.Empty;
            xrefPartType = string.Empty;

			orderLine = 0;
			orderRelNum = 1;
			orderLine = salesOrderAdapter.salesOrderData.OrderDtl[salesOrderAdapter.salesOrderData.OrderDtl.Count - 1].OrderLine;

			jobNumber = orderNumber.ToString()+"-" + orderLine.ToString() + "-1";

            //jobEntryAdapter.GetNextJobNum(out jobNumber);

            if (jobEntryAdapter.ValidateJobNum(jobNumber))
            {

                jobEntryAdapter.GetNewJobHead();
                jobEntryAdapter.JobEntryData.JobHead[0].JobNum = jobNumber;
                jobEntryAdapter.JobEntryData.JobHead[0].Plant = currentPlant;
                jobEntryAdapter.JobEntryData.JobHead[0].PartNum = partNum;				

                jobEntryAdapter.CheckPrePartInfo(ref partNum, Guid.Empty, skipXRefUpdate, xrefPartNum, xrefPartType, out vMsgText,
                    out vSubAvail, out vMsgType, out multipleMatch);

                jobEntryAdapter.ChangeJobHeadPartNum();

				jobEntryAdapter.JobEntryData.JobHead[0].PartDescription = partDesc;

                jobEntryAdapter.Update();
				jobEntryAdapter.GetByIdandJobType(jobNumber, "MFG");

                foreach (AssemblyListAssemblyOperation operation in header.OperationList)
                {
                    proposedOpCode = operation.OperationCode;
                    jobEntryAdapter.GetNewJobOper(jobNumber, 0);
                    jobEntryAdapter.ChangeJobOperOpCode(proposedOpCode, out refreshMessage);

                    jobEntryAdapter.JobEntryData.JobOper[jobEntryAdapter.JobEntryData.JobOper.Count - 1].ProdStandard = operation.Hours;
                    jobEntryAdapter.JobEntryData.JobOper[jobEntryAdapter.JobEntryData.JobOper.Count - 1].StdFormat = operation.Units;

                    jobEntryAdapter.ChangeJobOperProdStandard();
                    jobEntryAdapter.Update();
                }


                foreach (AssemblyListAssemblyMaterial material in header.MaterialList)
                {
                    ipPartNum = material.PartNo;

                    jobEntryAdapter.GetNewJobMtl(jobNumber, 0);
                    jobEntryAdapter.JobEntryData.JobMtl[jobEntryAdapter.JobEntryData.JobMtl.Count - 1].QtyPer = material.Quantity;

                    jobEntryAdapter.ChangeJobMtlPartNum(true, ref ipPartNum, Guid.Empty, string.Empty, string.Empty, out vMsgText, out vSubAvail, out vMsgType, out multipleMatch,
                        out opPartChgCompleted, out opMtlIssuedAction);

                    jobEntryAdapter.ChangeJobMtlQtyPer();
                    jobEntryAdapter.ChangeJobMtlEstSplitCosts();
					jobEntryAdapter.ChangeJobMtlIUM(material.Units);
                    jobEntryAdapter.Update();
                }


                


                jobEntryAdapter.GetNewJobProd(jobNumber, partNum, orderNumber, orderLine, orderRelNum, "", "", 0);
                jobEntryAdapter.CheckJobProdMakeToType("ORDER");
                jobEntryAdapter.ChangeJobProdMakeToType();

                jobEntryAdapter.JobEntryData.JobProd[jobEntryAdapter.JobEntryData.JobProd.Count - 1].OrderNum = orderNumber;
                jobEntryAdapter.ChangeJobProdOrderNum();

                jobEntryAdapter.JobEntryData.JobProd[jobEntryAdapter.JobEntryData.JobProd.Count - 1].OrderLine = orderLine;
                jobEntryAdapter.ChangeJobProdOrderLine();

                jobEntryAdapter.JobEntryData.JobProd[jobEntryAdapter.JobEntryData.JobProd.Count - 1].OrderRelNum = orderRelNum;
                jobEntryAdapter.CheckChangeJobProdOrderRelNum(orderRelNum);

                jobEntryAdapter.ChangeJobProdOrderRelNum();
                jobEntryAdapter.Update();
                flag = true;

				jobEntryAdapter.Dispose();
        		jobEntryAdapter = null;
            }
        }
        catch (Exception ex)
        {
            MessageBox.Show("There was an error creating the job", "Error");
			string  errorMessage = ex.Message;
            flag = false;
        }		
        return flag;
    }

}


/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class AssemblyList
{

    private AssemblyListAssembly[] assemblyField;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Assembly")]
    public AssemblyListAssembly[] Assembly
    {
        get
        {
            return this.assemblyField;
        }
        set
        {
            this.assemblyField = value;
        }
    }
}

/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class AssemblyListAssembly
{

    private AssemblyListAssemblyHeaderInfo headerInfoField;

    private AssemblyListAssemblyOperation[] operationListField;

    private AssemblyListAssemblyMaterial[] materialListField;

    /// <remarks/>
    public AssemblyListAssemblyHeaderInfo HeaderInfo
    {
        get
        {
            return this.headerInfoField;
        }
        set
        {
            this.headerInfoField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlArrayItemAttribute("Operation", IsNullable = false)]
    public AssemblyListAssemblyOperation[] OperationList
    {
        get
        {
            return this.operationListField;
        }
        set
        {
            this.operationListField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlArrayItemAttribute("Material", IsNullable = false)]
    public AssemblyListAssemblyMaterial[] MaterialList
    {
        get
        {
            return this.materialListField;
        }
        set
        {
            this.materialListField = value;
        }
    }
}

/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class AssemblyListAssemblyHeaderInfo
{

    private string partNoField;

    private string partDescriptionField;

    private byte orderQuantityField;

    private string currencyField;

    private decimal unitPriceField;

    private decimal unitWidthField;

    private decimal unitHeightField;

    private decimal unitLengthField;

    private decimal unitNetWeightField;

    private string lWHUnitsField;

    private string weightUnitsField;

	private bool includeMOMField;

    /// <remarks/>
    public string PartNo
    {
        get
        {
            return this.partNoField;
        }
        set
        {
            this.partNoField = value;
        }
    }

    /// <remarks/>
    public string PartDescription
    {
        get
        {
            return this.partDescriptionField;
        }
        set
        {
            this.partDescriptionField = value;
        }
    }

    /// <remarks/>
    public byte OrderQuantity
    {
        get
        {
            return this.orderQuantityField;
        }
        set
        {
            this.orderQuantityField = value;
        }
    }

    /// <remarks/>
    public string Currency
    {
        get
        {
            return this.currencyField;
        }
        set
        {
            this.currencyField = value;
        }
    }

    /// <remarks/>
    public decimal UnitPrice
    {
        get
        {
            return this.unitPriceField;
        }
        set
        {
            this.unitPriceField = value;
        }
    }

    /// <remarks/>
    public decimal UnitWidth
    {
        get
        {
            return this.unitWidthField;
        }
        set
        {
            this.unitWidthField = value;
        }
    }

    /// <remarks/>
    public decimal UnitHeight
    {
        get
        {
            return this.unitHeightField;
        }
        set
        {
            this.unitHeightField = value;
        }
    }

    /// <remarks/>
    public decimal UnitLength
    {
        get
        {
            return this.unitLengthField;
        }
        set
        {
            this.unitLengthField = value;
        }
    }

    /// <remarks/>
    public decimal UnitNetWeight
    {
        get
        {
            return this.unitNetWeightField;
        }
        set
        {
            this.unitNetWeightField = value;
        }
    }

    /// <remarks/>
    public string LWHUnits
    {
        get
        {
            return this.lWHUnitsField;
        }
        set
        {
            this.lWHUnitsField = value;
        }
    }

    /// <remarks/>
    public string WeightUnits
    {
        get
        {
            return this.weightUnitsField;
        }
        set
        {
            this.weightUnitsField = value;
        }
    }

	/// <remarks/>
	public bool IncludeMOM
	{
		get
		{
			return this.includeMOMField;
		}
		set
		{
			this.includeMOMField = value;
		}
	}
}

/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class AssemblyListAssemblyOperation
{

    private string operationCodeField;

    private decimal hoursField;

    private string unitsField;

    /// <remarks/>
    public string OperationCode
    {
        get
        {
            return this.operationCodeField;
        }
        set
        {
            this.operationCodeField = value;
        }
    }

    /// <remarks/>
    public decimal Hours
    {
        get
        {
            return this.hoursField;
        }
        set
        {
            this.hoursField = value;
        }
    }

    /// <remarks/>
    public string Units
    {
        get
        {
            return this.unitsField;
        }
        set
        {
            this.unitsField = value;
        }
    }
}

/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class AssemblyListAssemblyMaterial
{

    private string partNoField;

    private decimal quantityField;

    private string unitsField;

    /// <remarks/>
    public string PartNo
    {
        get
        {
            return this.partNoField;
        }
        set
        {
            this.partNoField = value;
        }
    }

    /// <remarks/>
    public decimal Quantity
    {
        get
        {
            return this.quantityField;
        }
        set
        {
            this.quantityField = value;
        }
    }

    /// <remarks/>
    public string Units
    {
        get
        {
            return this.unitsField;
        }
        set
        {
            this.unitsField = value;
        }
    }
}

public class frmProc : EpiBaseForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.pbProgress = new System.Windows.Forms.ProgressBar();
            this.lblStatus = new EpiLabel();
            this.SuspendLayout();
            // 
            // pbProgress
            // 
            this.pbProgress.Location = new System.Drawing.Point(12, 28);
            this.pbProgress.MarqueeAnimationSpeed = 25;
            this.pbProgress.Name = "pbProgress";
            this.pbProgress.Size = new System.Drawing.Size(460, 23);
            this.pbProgress.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
            this.pbProgress.TabIndex = 0;
            // 
            // lblStatus
            // 
            this.lblStatus.AutoSize = true;
            this.lblStatus.Location = new System.Drawing.Point(13, 9);
            this.lblStatus.Name = "lblStatus";
            this.lblStatus.Size = new System.Drawing.Size(91, 13);
            this.lblStatus.TabIndex = 1;
            this.lblStatus.Text = "Processing....";
            // 
            // frmProc
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(484, 84);
            this.ControlBox = false;
            this.Controls.Add(this.lblStatus);
            this.Controls.Add(this.pbProgress);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Name = "frmProc";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Processing Fansil / Comsil Import";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.ProgressBar pbProgress;
        private EpiLabel lblStatus;

        public frmProc()
        {
            InitializeComponent();
        }

        public void SetStatus(string Text)
        {
            this.lblStatus.Text = Text;
        }

	

	private void InitializeUD01Adapter()
	{
		// Create an instance of the Adapter.
		this._ud01Adapter = new UD01Adapter(this.oTrans);
		this._ud01Adapter.BOConnect();

		// Add Adapter Table to List of Views
		// This allows you to bind controls to the custom UD Table
		this._edvUD01 = new EpiDataView();
		this._edvUD01.dataView = new DataView(this._ud01Adapter.UD01Data.UD01);
		this._edvUD01.AddEnabled = true;
		this._edvUD01.AddText = "New UD01";
		if ((this.oTrans.EpiDataViews.ContainsKey("UD01View") == false))
		{
			this.oTrans.Add("UD01View", this._edvUD01);
		}

		// Initialize DataTable variable
		this.UD01_Column = this._ud01Adapter.UD01Data.UD01;

		// Initialize EpiDataView field.
		this._edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews["OrderDtl"]));

		// Set the parent view / keys for UD child view
		string[] parentKeyFields = new string[4];
		string[] childKeyFields = new string[4];
		parentKeyFields[0] = "Company";
		childKeyFields[0] = "Key1";
		parentKeyFields[1] = "OrderNum";
		childKeyFields[1] = "Key2";
		parentKeyFields[2] = "OrderLine";
		childKeyFields[2] = "Key3";
		parentKeyFields[3] = "PartNum";
		childKeyFields[3] = "Key4";
		this._edvUD01.SetParentView(this._edvOrderDtl, parentKeyFields, childKeyFields);

		if ((this.oTrans.PrimaryAdapter != null))
		{
			// this.oTrans.PrimaryAdapter.GetCurrentDataSet(Ice.Lib.Searches.DataSetMode.RowsDataSet).Tables.Add(this._edvUD01.dataView.Table.Clone())
		}

	}

	private void GetUD01Data(string key1, string key2, string key3, string key4, string key5)
	{
		if ((this._Key1UD01 != key1) || (this._Key2UD01 != key2) || (this._Key3UD01 != key3) || (this._Key4UD01 != key4) || (this._Key5UD01 != key5))
		{
			// Build where clause for search.
			string whereClause = "Key1 = \'" + key1 + "\' And Key2 = \'" + key2 + "\' And Key3 = \'" + key3 + "\' And Key4 = \'" + key4 + "\'";
			System.Collections.Hashtable whereClauses = new System.Collections.Hashtable(1);
			whereClauses.Add("UD01", whereClause);

			// Call the adapter search.
			SearchOptions searchOptions = SearchOptions.CreateRuntimeSearch(whereClauses, DataSetMode.RowsDataSet);
			this._ud01Adapter.InvokeSearch(searchOptions);

			if ((this._ud01Adapter.UD01Data.UD01.Rows.Count > 0))
			{
				this._edvUD01.Row = 0;
			} else
			{
				this._edvUD01.Row = -1;
			}

			// Notify that data was updated.
			this._edvUD01.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD01.Row, this._edvUD01.Column));

			// Set key fields to their new values.
			this._Key1UD01 = key1;
			this._Key2UD01 = key2;
			this._Key3UD01 = key3;
			this._Key4UD01 = key4;
			this._Key5UD01 = key5;
		}
	}

	private void GetNewUD01Record()
	{
		DataRow parentViewRow = this._edvOrderDtl.CurrentDataRow;
		// Check for existence of Parent Row.
		if ((parentViewRow == null))
		{
			return;
		}
		if (this._ud01Adapter.GetaNewUD01())
		{
			string company = parentViewRow["Company"].ToString();
			string ordernum = parentViewRow["OrderNum"].ToString();
			string orderline = parentViewRow["OrderLine"].ToString();
			string partnum = parentViewRow["PartNum"].ToString();

			// Get unique row count id for Key5
			int rowCount = this._ud01Adapter.UD01Data.UD01.Rows.Count;
			int lineNum = rowCount;
			bool goodIndex = false;
			while ((goodIndex == false))
			{
				// Check to see if index exists
				DataRow[] matchingRows = this._ud01Adapter.UD01Data.UD01.Select("Key5 = \'" + lineNum.ToString() + "\'");
				if ((matchingRows.Length > 0))
				{
					lineNum = (lineNum + 1);
				} else
				{
					goodIndex = true;
				}
			}

			// Set initial UD Key values
			DataRow editRow = this._ud01Adapter.UD01Data.UD01.Rows[(rowCount - 1)];
			editRow.BeginEdit();
			editRow["Key1"] = company;
			editRow["Key2"] = ordernum;
			editRow["Key3"] = orderline;
			editRow["Key4"] = partnum;
			editRow["Key5"] = lineNum.ToString();
			editRow.EndEdit();

			// Notify that data was updated.
			this._edvUD01.Notify(new EpiNotifyArgs(this.oTrans, (rowCount - 1), this._edvUD01.Column));
		}
	}

	private void SaveUD01Record()
	{
		// Save adapter data
		this._ud01Adapter.Update();
	}

	private void DeleteUD01Record()
	{
		// Check to see if deleted view is ancestor view
		bool isAncestorView = false;
		Ice.Lib.Framework.EpiDataView parView = this._edvUD01.ParentView;
		while ((parView != null))
		{
			if ((this.oTrans.LastView == parView))
			{
				isAncestorView = true;
				break;
			} else
			{
				parView = parView.ParentView;
			}
		}

		// If Ancestor View then delete all child rows
		if (isAncestorView)
		{
			DataRow[] drsDeleted = this._ud01Adapter.UD01Data.UD01.Select("Key1 = \'" + this._Key1UD01 + "\' AND Key2 = \'" + this._Key2UD01 + "\' AND Key3 = \'" + this._Key3UD01 + "\' AND Key4 = \'" + this._Key4UD01 + "\'");
			for (int i = 0; (i < drsDeleted.Length); i = (i + 1))
			{
				this._ud01Adapter.Delete(drsDeleted[i]);
			}
		} else
		{
			if ((this.oTrans.LastView == this._edvUD01))
			{
				if ((this._edvUD01.Row >= 0))
				{
					DataRow drDeleted = ((DataRow)(this._ud01Adapter.UD01Data.UD01.Rows[this._edvUD01.Row]));
					if ((drDeleted != null))
					{
						if (this._ud01Adapter.Delete(drDeleted))
						{
							if ((_edvUD01.Row > 0))
							{
								_edvUD01.Row = (_edvUD01.Row - 1);
							}

							// Notify that data was updated.
							this._edvUD01.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD01.Row, this._edvUD01.Column));
						}
					}
				}
			}
		}
	}

	private void UndoUD01Changes()
	{
		this._ud01Adapter.UD01Data.RejectChanges();

		// Notify that data was updated.
		this._edvUD01.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD01.Row, this._edvUD01.Column));
	}

	private void ClearUD01Data()
	{
		this._Key1UD01 = string.Empty;
		this._Key2UD01 = string.Empty;
		this._Key3UD01 = string.Empty;
		this._Key4UD01 = string.Empty;
		this._Key5UD01 = string.Empty;

		this._ud01Adapter.UD01Data.Clear();

		// Notify that data was updated.
		this._edvUD01.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD01.Row, this._edvUD01.Column));
	}

	private void baseToolbarsManager_ToolClickForUD01(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
	{
		// EpiMessageBox.Show(args.Tool.Key);
		switch (args.Tool.Key)
		{
			case "EpiAddNewNew UD01":
				GetNewUD01Record();
				break;

			case "ClearTool":
				ClearUD01Data();
				break;

			case "UndoTool":
				UndoUD01Changes();
				break;
		}
	}

	private void SalesOrderForm_BeforeToolClickForUD01(object sender, Ice.Lib.Framework.BeforeToolClickEventArgs args)
	{
		// EpiMessageBox.Show(args.Tool.Key);
		switch (args.Tool.Key)
		{
			case "SaveTool":
				SaveUD01Record();
				break;
		}
	}

	private void SalesOrderForm_AfterToolClickForUD01(object sender, Ice.Lib.Framework.AfterToolClickEventArgs args)
	{
		// EpiMessageBox.Show(args.Tool.Key);
		switch (args.Tool.Key)
		{
			case "DeleteTool":
				if ((args.Cancelled == false))
				{
					DeleteUD01Record();
				}
				break;
		}
	}

	private void OrderDtl_AfterRowChangeForUD01(EpiRowChangedArgs args)
	{
		// ** add AfterRowChange event handler
		string company = args.CurrentView.dataView[args.CurrentRow]["Company"].ToString();
		string ordernum = args.CurrentView.dataView[args.CurrentRow]["OrderNum"].ToString();
		string orderline = args.CurrentView.dataView[args.CurrentRow]["OrderLine"].ToString();
		string partnum = args.CurrentView.dataView[args.CurrentRow]["PartNum"].ToString();
		GetUD01Data(company, ordernum, orderline, partnum, string.Empty);
	}

	private void OrderDtl_DataView_ListChangedForUD01(object sender, ListChangedEventArgs args)
	{
		// ** add ListChanged event handler
		string company = OrderDtl_DataView[0]["Company"].ToString();
		string ordernum = OrderDtl_DataView[0]["OrderNum"].ToString();
		string orderline = OrderDtl_DataView[0]["OrderLine"].ToString();
		string partnum = OrderDtl_DataView[0]["PartNum"].ToString();
		GetUD01Data(company, ordernum, orderline, partnum, string.Empty);
	}
}

Can you try a test with a clean version first? Looks like this customization was created in 2017. I would like to see if a clean one works.

Also check out this thread on formatting code blocks. It really helps keep things clean in here.

The clean one works. I compared my code to the clean code, it looks like the wizard appended the new code to the frmProc class instead of the Script class. Moving the generate code to the Script class, everything compiles now. Thanks for the help.

1 Like

Glad you were able to find it. I was looking for a while, but couldn’t figure out what the specific problem was (I’m still relatively new to this code thing)

ok, next problem. I added the tab and an EpiUltraGrid, my UD table does not show in the EpiBinding for the grid. Should it? Or am I doing something wrong.

It should show up. I’m pretty sure you have to save the customization, close and reload it to get the new view to show up. Did you do that?

I have this running, added the UD table as a child table and bound the UD table to an EpiUltraGrid for editing the list. Everything appears to work fine and does what we want. However, the UD data for the order only loads on a new instance of the Sales Order window. If we try to load a another order in the existing window, the UD don’t populate the EpiUltraGrid. Closing Sales Order Entry each time we want to view or edit an order is the only way to get the UD table to populate the EpiUltraGtrid. Any ideas?