Thank you Tanesh. Now that I have made the changes you suggested, I am now receiving a different error message.
Compiling Custom Code ...
----------errors and warnings------------
Error: CS1061 - line 63 (197) - 'Ice.Lib.Framework.EpiDataView' does not contain a definition for 'dataview' and no extension method 'dataview' accepting a first argument of type 'Ice.Lib.Framework.EpiDataView' could be found (are you missing a using directive or an assembly reference?)
** Compile Failed. **
As you can see from the coding in a prior message I do have the using Ice.Lib.Framework; invoked. Do I need another assembly reference?
I see that case is important in coding! Thank you!
I am receiving no compiling error messages now and I have finally reached the point where the {CallContextBpmData.ShortChar01} field is being populated.
However, instead of inserting the actual Pack Slip number, it is inserting text that appears to be the name of an Assembly Reference. As you can see in the image below, I have used the native control reference for the txtKeyField (PackSlip). If I change it to opts.ContextValue = “txtKeyField”; then ‘txtKeyField’ is what populates in the {CallContextBpmData.ShortChar01} field. Any ideas?
Tanesh, can you clarify the syntax of the .Text property?
I have tried several configurations of it to set the opts.ContextValue in the ShowCustomMtlTags() but to no avail. Should I get the value of txtKeyField by using the GetNativeControlReference ID or is there a better way to acheive this?
EpiTextBox is similar to the .NET TextBox control and exposes similar properties.
So to get the text from this control, you look at its Text property
string packSlip = txtPackSlip.Text;
This will get the job done, but it’s generally better to get the data from the control’s data source instead. So ideally, you should be doing something like this:
I have edited the code for the ShowCustomMtlTags() and it compiles successfully. However, when I query the CallContextBpmData table in SQL, the ShortChar01 field is not populated with the PackSlip number. Below is my code:
Okay, I changed RcvDtl to ReceiptRcvDtl as you suggested above and it compiles successfully. I am still not seeing any information in the callContextBpmData.ShortChar01 field when I query it in SQL. Could it be in the Print Material Tags form’s customization that is not setting the value correctly due to case or wrong syntax? Below is the MtlTagsForm_Load() code. Do you see anything that stands out?
From your screenshot above where you queried the table in SSMS and saw a value in ShortChar01 (the EpiTextBox control name), it seems like the material tags form is working okay. Unless you’ve made any changes to the form since then, I doubt that’s the problem.
I would open up the receipt entry customization in a debugger and verify that it’s actually getting the packslip value when the LaunchFormOptions object is being built.
A couple of questions. I am new to debugging. Do you have a recommendation on a debugger. I see many out there available. Also, how do I find the receipt entry customization to debug? Is it located in the C:\ProgramData\Epicor<server name>\3.2.200.0<company>\CustomDLLs folder? Sorry to sound like such a neophyte!
I use Visual Studio. Just launch the screen through Customization Maintenance from Actions - Modify Customization (or by opening the customization using developer mode). When you get the screen which lets you pick a customization or launch the base form, check the “Debug in Visual Studio” checkbox and open your customization.
From there, it’s a fairly standard debugging process - setting breakpoints and inspecting values - for which you can find plenty of documentation online.
I discovered that the version of Visual Studio I was using with Epicor 10.2.200.13 did not work. I installed Visual Studio 2015 and the ‘Debug in Visual Studio’ checkbox was no longer grayed out.
This is where I am at. I have managed to debug the Receipt Entry Customization and it is setting the ContextValue for the pack slip number and passing it to the Print Material Tags form. When I then ran debugging on the MtlTags customization, I could see that the pack slip number was there in the LaunchFormOptions; however, for some reason this line of code is not placing the pack slip number in to “ShortChar01” because when I run a SELECT statement in SQL on the callContextBpmData table, that column is blank. Any ideas?
I have an update to this. When I run the customization through the debugging process all the way to the end and generate the labels, I can see the pack slip number is populated in callContextBpmData.ShortChar01 in my SELECT statement. HOWEVER, when I generate the labels without debugging, it does not populate the pack slip number in to ShortChar01.
Can you confirm that your material tags customization is called when you generate the tags through receipt entry? Running the receipt entry screen in dev mode should show you the menu ID of the process being called, and you can verify that it’s linked to your material tags customization.
Indeed, the customization was not set in Menu Maintenance for the Mtl Tags form. Not sure how it got removed, but I put it back.
Now when the Mtl Tag dialog is launched from receipt entry, I immediately get an error message before the form even appears. Are you familiar with this message? When I click on OK, the Mtl Tag form then appears and when I generate labels, the ShortChar01 field is not being populated.
Detail is as follows:
Application Error
Exception caught in: mscorlib
Error Detail
============
Message: Exception has been thrown by the target of an invocation.
Inner Exception Message: Object reference not set to an instance of an object.
Program: CommonLanguageRuntimeLibrary
Method: InvokeMethod
Client Stack Trace
==================
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeScriptMethod(MethodInfo scriptMethod, Object[] parameters)
at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeCustomFormLoadIfExists(String methodName, Object sender, EventArgs e)
at Ice.Lib.Customization.CustomScriptManager.<>c__DisplayClass103_0.<OnCustomCodeFormLoad>b__0()
at Ice.Lib.Customization.CustomScriptManager.TryActionShowExceptionBoxOrLogVerificationErrorIfException(Action action, String exceptionBoxTitle)
Inner Exception
===============
Object reference not set to an instance of an object.
at Script.MtlTagsForm_Load(Object sender, EventArgs args)