I am working through some custom code on a method directive, whereby, I’d like to reference the existing value on a particular text box. Then - when that value is changed directly on the form and the record saved, I’d like to reference the new value that was placed into that text box.
The textbox that I am isolating is a custom field that my company has created off of the “HDCase” table. Here are the properties of that textbox:
The control properties list the control type as “Ice.Lib.Framework.EpiTextBox”.
Seems reasonable… except that I cannot locate an “Ice.Lib.dll”, nor an “Ice.Lib.Framework.dll” file anywhere on the Epicor client - or - the Epicor server.
Two questions for the community concerning this:
[1] Has anyone else experienced this specific issue with the missing “Ice.Lib.Framework.dll” assembly? How did you get that resolved?
[2] What is the proper way to isolate and reference a textbox value in custom C# code?
[By the way… the term, “Ice.Lib.Framework” had no hits in the Ice Tools guide. The term, “Ice.Tools” had two hits on pages 748 and 750. The term, “EpiTextBox” had no hits. So, no, it’s not in the Ice Tools guide]
In the land of BPM, I think they want is to change our thinking from updating textboxes into changing data fields. Addressing Textboxes is how I thought when I was doing VB applications, so I understand your thought process.
BPMs are specifically separated from the presentation layer (well, they were earlier but things like BPMForms and MessageBoxes creeped back into the scene), so the best way to update the textbox is to update the data field bound to the textbox. So bind the UD field to the AirPlanetail textbox and you should get what you’re looking for.
If you really want to control textboxes then a Customization is the better tool.
Description: There is at least one compilation error.
Details:
Error CS0246: The type or namespace name ‘EpiDataView’ could not be found (are you missing a using directive or an assembly reference?) [Update.Post.Q-HelpDesk.Updat.cs(107,1)]
Error CS0103: The name ‘oTrans’ does not exist in the current context [Update.Post.Q-HelpDesk.Updat.cs(107,19)]
Program: Epicor.Customization.dll
Method: PrepareException
Line Number: 99
Column Number: 13
Looks like I don’t have my “oTrans” object defined, as well. I’ve seen this object referenced in countless examples, so it appears to be something universal that everyone understands. What guidance might you have on that object, as well?
Oh WAIT you are working on a method directive… not a customization?
You can’t access TextBox… (or any controls for that matter ) on the Method Directive side.
In the method directive the UD Field is available as part of the dataset for the method under the ttHDCase table.
There is a fundamental misunderstanding here, BPMs run server side and thus the client side controls are not available, rather only the data passed on the method.
For future reference you may want to read through the Customization Guides and the Ice Tool Guide and consider taking an education class specially if you’re going to Insights (its cheaper there). You need a certain knowledge of the architecture to ensure that you are successful at modifying the system properly and can pick the right tool for the right job
To get a hold of that field you want to access it from the ttHDCase table like so
var myvalue = ttHDCase.FirstOrDefault().UDField<string>("MyCustomField_c",false);
The approach I have on this is more to “log”, or record when someone changed a particular field value pertaining to, in this case, aircraft registration numbers. My company’s Customer Service department will occassionally deal with aircraft that might have been sold under one specific tail number - but - later on, that aircraft might have been resold and re-registered under a completely different tail number. When that happens, our CS staff would like to keep a “history” so that we can tie multiple tail registration numbers to the same aircraft serial.
In this case, I do not want to change any field values. What I’d like to do is - when that value is changed - capture the existing field value and then the updated field value. then, log this data into a UD table.
Jose - you are absolutely correct. I am going at this via a method directive (my thinking there is that I do not want to change, or manipulate the data in any way, but, merely capture the “before-and-after” field values.
Bill for this you can use the Change Log functionality. Epicor does this natively with most tables. If you enable Change Log you can tell it to track changes to a specific field and it will do so for you.
Check out the BPM Section of the Ice Tools User Guide Page 590 (Change Log) https://epicweb.epicor.com/doc/Docs/EpicorICETools_UserGuide_101500.pdf
Thanks, Jose… and thanks very much for the page location so that I’m not thumbing through 1,240 pages trying to uncover an answer for which I have no frame of reference.
I think my company wants to log these changes with the existing aircraft record (which is why I was trudging through this sort of approach), but there might be something within the change log that would work.