Job work flow/barcode scanning how to?

Hi,
I’ve been asked to do some “automation” with barcode scanning that will replace the fact that our planners currently unengineer jobs (which also unreleases it) so that they can change the Job’s Prod Team: drop down as the job progresses. Then they check Engineered and Released again. They also have custom reports that report on the Prod Team ID.
Management has suggested we replace this with the ability to scan a new barcode on the Job Traveler and set the Prod Team (or a new field that we can track/report on).

You might be saying why are you folks (y’all) even doing that in the first place and that is unusual. Answer: I don’t know, but we want to do what’s best.

So the newbie questions I have are:

  1. Is this where we should be using MES?
    AFAIK We don’t use it for anything currently. We are on Epicor 10.2.300.15 and I can see we are licensed for MESDataCollection and it’s Enabled.
  2. What needs to be done?
  3. How much time would you estimate that one person with some Epicor form customization/SSRS/BAQ/BPM/RDD experience would take to pull this off that has no MES/barcode scanning experience?
  4. What would be the best cost effective barcode scanner to get for this? We probably will need about 14 and we don’t do any scanning right now.

Also, We’ll also need additional minimal PCs/thin clients where the scanners are, so I guess we’ll need to consider if we’ll need addition Epicor licenses. I’m wondering if the license will free up 15 min after a scan.

Thanks,
Dave S.

1 Like

Exactly thinking that… so I’m asking why are you changing prod qty. I wouldn’t so you can track how often you aren’t hitting estimate. If you plan for x and only make y that sounds like a problem.

Before we can help more we would really have to understand why the qty is being changed what’s the objective/roadblock there?

Scanners get 2d, the barcodes can get quite large for the type of scanning your indicating. We use symbol but there are lots out there look at reviews and research symbology a bit.

I would personally avoid thin clients we went that route, and we found if you have a cache issue on a machine because everyone is using the same cache clearing it can become a nightmare. We buy refurb Lenovo mini clients as full desktops and they are cheaper than thin clients with win10 pro on them.

Hi Joshua, thanks for the quick response! They are changing Prod Team not Prod Qty.

Ahhhhh I got it I see now what you’re saying. So one hurdle you will have is in company config there is a flag to allow or disallow changes to engineered jobs. Unless you bastardize the database or change that flag no matter what you do you would always have to unengineer and reengineer the job. Of course you can do that in code, but it adds to the complexity.

The things to consider are:

  • Where will your scan field be?
  • What all information do you need in the barcode to achieve your change (you will learn this from call traces)
  • Run call traces so you know what adapter methods are being called as you take the actions by hand.
  • Be proficient enough to manually make those calls in code in order with the correct parameters to automate the steps for the end users

I work with a client who has heavily customized the job/MES process, including many fields related to the job header that need to change after the job is released. In this case, there are many fields so it made sense to dedicate a UD table to store these fields. This allows the fields to be editable regardless of the state of the job.

Thanks Adam and Joshua. Anyone got a ballpark time estimate based on what I have described so far?

Not enough scope defined and too many variables. It would depend a great deal on proficiency of the developer.

@DaveS I have an UBAQ that we use to do this, but I am wondering are you changing a used operation to a new team rather than having an operation per team? I wrote it with the understanding that they would set the team before starting to clock on, but I know they move stuff midstream all of the time.

I sometimes think the complexity of bar codes is overstated.

They are just a way of replicating key strokes in an image. Indeed a simple way to trouble shoot a bar code is scanning it in Notepad.

Putting bar codes on the job traveller is fairly straight forward and can save a lot of time.

I have previously had the requirement to display the job number and the operation represented as bar codes which allows the users to replicate the ‘Start Activity’ key strokes in MES.

In terms of SSRS, it is a question of working out what string you need to display and then applying the correct font. I use code 39.

1 Like

Just to get my feet wet, I created a UD## Maintenance Form customization (using Program Ice.UI.UD##Entry.dll).
I only left Key 1 Visible behavior TRUE (this is where I scan the Job Number to).
Then I created a UD## Update Pre-Processing Method Directive BPM that has the following:
Set Field 0 - Set the ttUD##.ShortChar01 field of the added row to the callContextClient.CurrentUserId expression
Set Field 1 - Set the ttUD##.Key2 field of the added row to the DateTime.Now.ToString(“MM-dd-yyyy HH:mm:ss:ff”) expression

So now when I call the form I:
Scan the Job from the Job Traveler
Press Tab
Click Yes Record Not Found. Add New? prompt
Press Save to write the row to the UD## table

At this point in a report or whatever, I could get the latest UD## table row for a job to report on the CurrentUserId.
Note: The idea is that the Job Traveler is scanned from a PC that is logged into Epicor where the userid is named the same as Prod Team ID.

Folks here are OK with me using this approach as long as I can now get rid of the clicks/kep presses (tab, Yes to Add New, Save, Close and Restart the Form) which would allow us to have this setup with Scanner/PC with no monitor, keyboard and mouse…this is a requirement.
Note: After the Save, using New or Clear shows all the keys visible which is not desired (don’t know why this is happening), so that is why I am having to Close and restart the form.

Any suggestions on how I could accomplish the click-less/kepress-less approach from where I’m at with this?

Many barcode scanners have a configuration setting that will allow you to append a suffix to the barcode payload. In some cases, it can be a tab, and the result is that the field is tabbed out of after scanning. I think some scanners have limited suffixes and, in some cases, we have had to detect the suffix in the customization and invoke a tab key stroke in code. In most cases, the tab setting work as expected.

To bypass the ‘Add New?’ dialog, try launching the form in developer mode, select your customization, create a new record and check off ‘do not show me this again’ checkbox. Then go into customization mode and save the customization. In my testing this made it so that all users no longer get the prompt when the customization is loaded.

You can automate the save by handling the AfterAdapterMethod but I don’t think this will be necessary after the above.

The issue with the keys reappearing. Sounds like you are fighting against the base logic which tries to reset the base controls. In addition to making the fields not visible, make the size and position as small as possible as well. If this doesn’t work, you probably need to handle the EpiViewNotification event or adapter method events to set the visibility back to false.

Adam, thanks for addressing each of my issues. Your Add New? tip worked. Thank you. However, the Save after was still necessary, so I’ll try your tip for that and the other tips and reply back to this post.

Adam, how/where to handle the AfterAdapterMethod? I can only get the AfterAdapterMethod to fire after I click Save. I used the Form Event Wizard.
Seems like I just need to find the right event to have something like this in…
oTrans.Update();
oTrans.NotifyAll();

Refer to this thread for a better way to hide the other keys in a persistent way

To automate the saving, there are many hooks you could use, one is the AfterExitEditMode event of the actual text box. Since it’s a native control, you need to get a reference and define the event manually:

EpiTextBox etb = (EpiTextBox)csm.GetNativeControlReference("46567b2e-6bc0-4967-be35-a0ec6843838f");
etb.AfterExitEditMode += (s, a) => {oTrans.Update();};

Verify the GUID above matches your Key1 textbox EpiGUID property, this is visible in the properties, in customization mode.

1 Like

Adam, thanks for that thread link…Also, I did get past that issue by resizing width and height of those text fields to their smallest.

What I’m not understanding is where do you define the event manually with that code to automate the saving? I can’t see where you do that.

see this post for adding an event handler to a native control.

The example in that post is for adding a Click event handler. Change all the references of Click to AfterExitEditMode

1 Like

Actually, don’t use a lamba expression as you will not have a reference to unsubscribe, which is good practice. Also declare a global reference to the text box to unsubscribe. This is equivalent but gives you a chance to remove the handler.

// Add Custom Module Level Variables Here **
EpiTextBox etb;

public void InitializeCustomCode()
{
	...
	// End Wizard Added Custom Method Calls
	etb = (EpiTextBox)csm.GetNativeControlReference("46567b2e-6bc0-4967-be35-a0ec6843838f");
	etb.AfterExitEditMode += new System.EventHandler(this.etb_AfterExitEditMode);
}

public void DestroyCustomCode()
{
	...
	// Begin Custom Code Disposal
            etb.AfterExitEditMode -= new System.EventHandler(this.etb_AfterExitEditMode);
	// End Custom Code Disposal
}

private void etb_AfterExitEditMode(object sender, System.EventArgs args)
{
	// ** Place Event Handling Code Here **
	oTrans.Update();
}

Thanks guys. I can see I’m hitting the oTrans.Update() breakpoint in the debugger, but I’m still having to click the Save button after because it’s not writing to the db otherwise. I’m thinking the timing might be too early since maybe the Add New? and my BPM hasn’t run yet.
Any ideas?
BTW I used the code from Adam.
Also, if I can’t get something working along those lines, I was wondering if a barcode scanner is out there that would support multiple suffixes to the barcode payload e.g. Tab, Save, Exit, Reload the Form. Without it saving those suffixes to the Key1 field used for Job#. Dunno if I’ll need any pauses.
I could setup hotkeys to support that. The reason I mention Exit and Reload the Form is because nothing else is working so that I can scan again, then tab, then save after the first scan e.g. New and Clear don’t work.
I know I could have a hotkey for Exit, but I wouldn’t know how to reload the form. BTW, I’m also going to need to automate starting this form when the pc is restarted.

Added a custom control that gets tabbed to after Key1 with this code and it works now.

	private void epiTextBoxC1_AfterEnterEditMode(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		oTrans.Update();
	}

My remaining 2 issues for completing this are:

  1. How to do get the next scan(s) after the first one to work as I’ve mentioned prior. What might work is if I can simply automatically close and reopen the form from just after the oTrans.Update() in epiTextBoxC1_AfterEnterEditMode, but I don’t know how.
  2. When the no monitor “headless” PC boots I can get it to start with the following shortcut in a sysconfig that I created by File, Send as File when the form was loaded, but go figure that it starts with the List Tab having focus. How to get it to start with the Detail tab having focus?
  <Shortcut>
    <Company>ACME</Company>
    <Plant>AcmeMfgSys</Plant>
    <AppServerURL>net.tcp://EPICOR/ERPTEST</AppServerURL>
    <DateTime>1/4/2021 8:09:51 AM</DateTime>
    <Originator>My Name</Originator>
    <Process>
      <ProcessID>UDSCANPT</ProcessID>
      <Description>Scan</Description>
    </Process>
    <RecordIDS KeyFields="Key1~Key2~Key3~Key4~Key5" KeyFieldsType="System.String~System.String~System.String~System.String~System.String" TableName="UD38" DataSourceType="UD38DataSet" />
    <Search>
      <NamedSearch>Search Name</NamedSearch>
      <SearchCriteria>Search Criteria</SearchCriteria>
    </Search>
  </Shortcut>