Custom Form Problem

Just wanted to say thanks for all the help on this and after various testing the solution that worked for us was from Jim and was identical copies of the customisation with each Employee name :)

We use Kanban Entry to enter our Finished Goods and this automatically prints a label for the box.  In order to allow multiple labels to be printed per entry I have customised the Number01 and Number02 fields on the JobHead table (one is parts per box and one is quantity of boxes). All this works fine and is updated by a pop-up box on the form after the  Quantity field has been changed.


However, my problem is that our Despatch department all share one Vantage log-on and have separate Employee ID's - they each have a Kanban window open and they are constantly on and off the PC.  The customisation only seems to work on the last copy of the form that is opened... does anyone have any suggestions on how I can work round this?  We're on Vantage 8.03.409a and would appreciate any suggestions.  Thanks.

Also, with further testing, I notice this happens on our client PC's in Test and Live databases but our Test Environment which is Server 2008 doesn't seem to have a problem?

How are you building and presenting the popup?  Can you include some snippets of code?  How are the users logging in?  (regular client or MES or both). 

Jim Kinneman
Encompass Solutions.

The users are logging in via regular client, and sample of code is below.  I have set it this way because there aren't any UD fields on Kanban entry and we have a BPM that takes this data and puts it into the JobHead table.  The easiest way to do this would be for me to enable the LegalNumber field but have not managed that either :/


Hope you can help - Thanks :)


  Select Case args.Column.ColumnName
 
   Case "Quantity"
             Dim [edvKanbanView] As EpiDataView = CType(oTrans.EpiDataViews("kanbanView"), EpiDataView)
                Dim qtyPerLabel As String = InputBox("Please Enter Quantity of Parts Packed Per Box?  (IF ONLY 1 BOX OF PARTS THEN JUST HIT RETURN \ OK)","QUANTITY OF PARTS PER BOX")
                    If qtyPerLabel = "" Then
                        qtyPerLabel = edvKanbanView.DataView(edvKanbanView.Row)("Quantity")
                    End If
                edvKanbanView.DataView(edvKanbanView.Row)("LegalNumber") = qtyPerLabel
   Case Else
 
  End Select

This may be out in left field but you are updating the dataview that just caused the input box to appear.  This might be causing some recursion that isn't handled well.  One purpose of beginedit and endedit I believe is to turn off events watching for changes.  You might try putting

edvKanbanView.DataView(edvKanbanView.Row).BeginEdit()
edvKanbanView.DataView(edvKanbanView.Row)("LegalNumber") = qtyPerLabel
edvKanbanView.DataView(edvKanbanView.Row).EndEdit()

Jim Kinneman
Encompass Solutions, Inc

Thanks for replying.  The field is updating if the input box appears but my problem is that the box isn't always appearing and I believe you're correct in that it is due to some recursion on the form.  I'm just not sure how to get round it!

Did adding the beginedit and endedit have any effect?

It may also be that the change event is not being trapped consistently.

Instead of an input box you can programmaticly add a popup form using a show dialog construct.  This is a bit more programing than a one line input box but may give you more control over its appearance. 


Jim Kinneman
Encompass Solutions, Inc.

Sorry but I didn't get chance to try the changes until today and am still trying to see if they help.


If it doesn't work, could you point me in the direction of the pop up form?  Thank you for checking and all your advice so far :)

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspx has an example of building a form via program calls.  For your purposes I would declare the form as a global and build it as part of the initialize step.  Then call form1.ShowDialog(); when you want to talk to the user. 

This approach will only work if you are able to consistently trap the event or events that identity the situation.  So before getting too involved with how to get the answer from the user I'd nail down that first.  It sometimes takes multiple/different event watching/trapping to catch all the situations that change something.

Jim Kinneman
Encompass Solutions, Inc

Thanks for the link. Just to let you know the Begin\EndEdit didn't seem to make a difference and I agree my problem is trapping the change. Unfortunately with Kanban once the 'Update' button has been hit it's too late and it doesn't seem to be working consistently elsewhere. I will keep trying anyway!

So your customization doesn't show up on some of the sessions? Is that what I am understanding?

On Dec 11, 2013 7:52 AM, <tracy.smith@...> wrote:

Â
<div>
  
  
  <p><p>Thanks for the link.  Just to let you know the Begin&#92;EndEdit didn&#39;t seem to make a difference and I agree my problem is trapping the change.  Unfortunately with Kanban once the &#39;Update&#39; button has been hit it&#39;s too late and it doesn&#39;t seem to be working consistently elsewhere.  I will keep trying anyway!<br>

</div>
 


<div style="color:#fff;min-height:0;"></div>

The form customisation opens correctly and there is an AfterFieldChange event that needs to run in order for me to be able to temporarily update the LegalNumber (I can't enable it). 


The problem we have is we have multiple versions of the same form (3 or 4) open - 1 for each Shop Employee - and the event only seems to run on the last form opened.

Is this in an Terminal Server environment?

See when you register interest in an event, all of the registered interests should fire unless you handle that event in your code.

What's your event code?



Jose C Gomez
Software Engineer


T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Wed, Dec 11, 2013 at 8:44 AM, <tracy.smith@...> wrote:

Â
<div>
  
  
  <p></p><p>The form customisation opens correctly and there is an AfterFieldChange event that needs to run in order for me to be able to temporarily update the LegalNumber (I can&#39;t enable it).  </p><p><br></p><p>

The problem we have is we have multiple versions of the same form (3 or 4) open - 1 for each Shop Employee - and the event only seems to run on the last form opened.

</div>
 


<div style="color:#fff;min-height:0;"></div>

Hi.  No, it's not terminal server - we have a couple of PC's that are used by about 6 or 7 Despatch employees and they use it as follows:


Log-into Vantage with User ID

Open Kanban Receipts and enter Employee ID

Then another person will come and open another Kanban Receipts form with a new Employee ID

And maybe another


No more than 4 users will be using the PC at the same time but as they are constantly nipping on and off throughout the shift they leave the form open.


Snippet of code below opens an input box requesting a number that is then temporarily stored in the LegalNumber for a BPM to pick up and write to JobHead table when the Kanban is processed.  We don't use Legal Numbers which is why we can use the field in this way and to be honest if I could figure out how to enable the field I wouldn't even need this event :/  Any advice would be appreciated!


Private Sub KanbanReceipts_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles KanbanReceipts_Column.ColumnChanged
        '// ** Argument Properties and Uses **
        '// args.Row("[FieldName]")
        '// args.Column, args.ProposedValue, args.Row
        '
        'Add Event Handler Code
        '
        Select Case args.Column.ColumnName
   
            Case "Quantity"
                Dim [edvKanbanView] As EpiDataView = CType(oTrans.EpiDataViews("kanbanView"), EpiDataView)
                Dim qtyPerLabel As String = InputBox("Please Enter Quantity of Parts Packed Per Box?  (IF ONLY 1 BOX OF PARTS THEN JUST HIT RETURN \ OK)","QUANTITY OF PARTS PER BOX")
                    If qtyPerLabel = "" Then
                        qtyPerLabel = edvKanbanView.DataView(edvKanbanView.Row)("Quantity")
                    End If
                edvKanbanView.DataView(edvKanbanView.Row)("LegalNumber") = qtyPerLabel
            Case Else
   
        End Select
   
    End Sub

Oh wait this is on the SAME computer?


Jose C Gomez

Software Engineer


T: 904.469.1524 mobile
E: jose@…

http://www.josecgomez.com
     Â


Quis custodiet ipsos custodes?


On Wed, Dec 11, 2013 at 9:10 AM, <tracy.smith@...> wrote:

Â
<div>
  
  
  <p></p><p>Hi.  No, it&#39;s not terminal server - we have a couple of PC&#39;s that are used by about 6 or 7 Despatch employees and they use it as follows:</p><p><br></p><p>Log-into Vantage with User ID</p><p>Open Kanban Receipts and enter Employee ID</p>

Then another person will come and open another Kanban Receipts form with a new Employee ID

And maybe another


No more than 4 users will be using the PC at the same time but as they are constantly nipping on and off throughout the shift they leave the form open.


Snippet of code below opens an input box requesting a number that is then temporarily stored in the LegalNumber for a BPM to pick up and write to JobHead table when the Kanban is processed. We don't use Legal Numbers which is why we can use the field in this way and to be honest if I could figure out how to enable the field I wouldn't even need this event :/ Any advice would be appreciated!


Private Sub KanbanReceipts_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles KanbanReceipts_Column.ColumnChanged
       '// ** Argument Properties and Uses **

       '// args.Row("[FieldName]")
       '// args.Column, args.ProposedValue, args.Row
       '
       'Add Event Handler Code


       '
       Select Case args.Column.ColumnName

  Â
           Case "Quantity"
               Dim [edvKanbanView] As EpiDataView = CType(oTrans.EpiDataViews("kanbanView"), EpiDataView)
               Dim qtyPerLabel As String = InputBox("Please Enter Quantity of Parts Packed Per Box? (IF ONLY 1 BOX OF PARTS THEN JUST HIT RETURN \ OK)","QUANTITY OF PARTS PER BOX")

                   If qtyPerLabel = "" Then
                       qtyPerLabel = edvKanbanView.DataView(edvKanbanView.Row)("Quantity")
                   End If

               edvKanbanView.DataView(edvKanbanView.Row)("LegalNumber") = qtyPerLabel

           Case Else
  Â
       End Select
  Â
   End Sub

</div>
 


<div style="color:#fff;min-height:0;"></div>

I just did the same setup in my computer and it works just fine, also why do they open multiple screens? Why can't they just use the one screen and change the Employee ID?


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Wed, Dec 11, 2013 at 11:58 AM, Jose Gomez <jose@...> wrote:
Oh wait this is on the SAME computer?


Jose C Gomez

Software Engineer


T: 904.469.1524 mobile

E: jose@...
http://www.josecgomez.com
     Â

Quis custodiet ipsos custodes?


On Wed, Dec 11, 2013 at 9:10 AM, <tracy.smith@...> wrote:

Â
<div>
  
  
  <p></p><p>Hi.  No, it&#39;s not terminal server - we have a couple of PC&#39;s that are used by about 6 or 7 Despatch employees and they use it as follows:</p><p><br></p><p>Log-into Vantage with User ID</p><p>Open Kanban Receipts and enter Employee ID</p>

Then another person will come and open another Kanban Receipts form with a new Employee ID

And maybe another


No more than 4 users will be using the PC at the same time but as they are constantly nipping on and off throughout the shift they leave the form open.


Snippet of code below opens an input box requesting a number that is then temporarily stored in the LegalNumber for a BPM to pick up and write to JobHead table when the Kanban is processed. We don't use Legal Numbers which is why we can use the field in this way and to be honest if I could figure out how to enable the field I wouldn't even need this event :/ Any advice would be appreciated!


Private Sub KanbanReceipts_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles KanbanReceipts_Column.ColumnChanged
       '// ** Argument Properties and Uses **

       '// args.Row("[FieldName]")
       '// args.Column, args.ProposedValue, args.Row
       '
       'Add Event Handler Code


       '
       Select Case args.Column.ColumnName

  Â
           Case "Quantity"
               Dim [edvKanbanView] As EpiDataView = CType(oTrans.EpiDataViews("kanbanView"), EpiDataView)
               Dim qtyPerLabel As String = InputBox("Please Enter Quantity of Parts Packed Per Box? (IF ONLY 1 BOX OF PARTS THEN JUST HIT RETURN \ OK)","QUANTITY OF PARTS PER BOX")

                   If qtyPerLabel = "" Then
                       qtyPerLabel = edvKanbanView.DataView(edvKanbanView.Row)("Quantity")
                   End If

               edvKanbanView.DataView(edvKanbanView.Row)("LegalNumber") = qtyPerLabel

           Case Else
  Â
       End Select
  Â
   End Sub

</div>
 


<div style="color:#fff;min-height:0;"></div>


Hi Jose.  It's change, and they don't like change!  Think main reasons they have their own screens open are that you can't just change the Employee and that you have to refresh the screen first and also they like to see the tree list on the left hand side of the screen for what they've already entered.  To be fair they are constantly on and off so can understand why Epicor advised them to use it like this.


Out of curiousity did you test on a client PC?  I get the same results if I test on my client but if I test on my test environment (totally separate server) then I don't have any problems either.


I appreciate you taking a look - thanks.

This is a stretch but if you are launching the same form multiple times memory caching may an issue.  How do you get the same form to come up multiple times in the same session?  Do you hold down the shift key when launching?  This will give each launch its own copy in memory.


Jim Kinneman

Encompass Solutions, Inc.

Hi Jim.  Yes, they press the shift key to open additional forms - hopefully customisation on Kanban Receipts might be slightly easier when we upgrade to E9!