[Solved] MES Customization v9.05

I think mine wasn't getting rid of the grid rows because I was putting the LaborHedSeq and LaborDtlSeq in directly and not using the launchformoptions. This code worked for me and removed the rows from the grid


If edvLaborDtl.dataView.Count > 0 Then
Dim vLaborHedSeq As String = edvLaborDtl.dataView(edvLaborDtl.Row)("LaborHedSeq").tostring
Dim vLaborDtlSeq As String = edvLaborDtl.dataView(edvLaborDtl.Row)("LaborDtlSeq").tostring
Dim lfo AS LaunchFormOptions = new LaunchFormOptions()
lfo.IsModal = true
lfo.SuppressFormSearch = true
lfo.ValueIn = vLaborHedSeq + "," + vLaborDtlSeq 
ProcessCaller.LaunchForm(MESMenu,"UDEndAct", lfo )
Script.OTrans.GetLaborData()

End If

Hello Group,


I'm doing a customization to the MES screen. My customization is a new button that launches the Base Version of the End Activity screen. 


I've arrived at the point where I have the new button that launches the End Activity Screen in its base form for the job highlighted in the production grid. However after I enter the data into the End Activity screen and click OK the Grid on the Main MES Screen does not update and the job remains in the Grid.


If I use the End Activity button that is already on the screen (the Epicor out of the box button) after the information is entered the grid updates and the job is removed. This has to be some type of logic in the button click i that refreshes the grid after the click of the 'OK' button inside the End Activity Screen, any help on how that is done would be appreciated.


Thanks,

Jarrad

>> click OK the Grid on the Main MES Screen does not update

You might include a refresh or update?

oTrans.Refresh()
oTrans.Update()
Or if you can provide your customization details it might be easier to spot what is going on.


Let me try to better explain my issue:

The user clocks into a job, once the person clocks into a job it appears in the Production tab's grid on the MES main screen.

Now the user clicks on the job they are clocking out on inside the grid highlighting it and clicks the End Activity button. When the user does this it launches a separate screen, the end activity screen, here the user enters their information and clicks okay. 

When the user clicks "OK" in the End Activity screen what SHOULD happen is the End Activity screen closes and the job that was highlighted is removed from the grid. This does happen with the out of the box End Activity Button. However my customization is the addition of another button that calls the End Activity screen, its using the Process Caller to call a menu ID I made that is the base End Activity. When I use my button it launches the End Activity form for the Job highlighted but when I click "OK" it closes the form but does not update the grid and remove the job. If I close the form and re-open it, the job is gone. So the only issue is the grid isn't updating. I've put oTrans.Refresh() and oTrans.NotifyAll() and that hasn't help, I think this is because it needs to be triggered off of the close of the End Activity form, if I put it below my code now in the click event it happens before the data is entered.

sample of my code:


Private Sub btnEndActBase_Click(ByVal sender As Object, ByVal args As System.EventArgs)
' ** Place Event Handling Code Here **
If edvLaborDtl.dataView.Count > 0 Then
Dim vLaborHedSeq As String = edvLaborDtl.dataView(edvLaborDtl.Row)("LaborHedSeq").tostring
Dim vLaborDtlSeq As String = edvLaborDtl.dataView(edvLaborDtl.Row)("LaborDtlSeq").tostring
ProcessCaller.LaunchForm(MESMenu,"UDEndAct", vLaborHedSeq + "," + vLaborDtlSeq )
End If
End Sub

Invoke this after your ProcessCaller
this.RefreshLaborData();


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Mon, Oct 26, 2015 at 10:37 AM, jarradlayne@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Let me try to better explain my issue:</p><div><br></div><div>The user clocks into a job, once the person clocks into a job it appears in the Production tab&#39;s grid on the MES main screen.</div><div><br></div><div>Now the user clicks on the job they are clocking out on inside the grid highlighting it and clicks the End Activity button. When the user does this it launches a separate screen, the end activity screen, here the user enters their information and clicks okay. </div><div><br></div><div>When the user clicks &quot;OK&quot; in the End Activity screen what SHOULD happen is the End Activity screen closes and the job that was highlighted is removed from the grid. This does happen with the out of the box End Activity Button. However my customization is the addition of another button that calls the End Activity screen, its using the Process Caller to call a menu ID I made that is the base End Activity. When I use my button it launches the End Activity form for the Job highlighted but when I click &quot;OK&quot; it closes the form but does not update the grid and remove the job. If I close the form and re-open it, the job is gone. So the only issue is the grid isn&#39;t updating. I&#39;ve put oTrans.Refresh() and oTrans.NotifyAll() and that hasn&#39;t help, I think this is because it needs to be triggered off of the close of the End Activity form, if I put it below my code now in the click event it happens before the data is entered.</div><div><br></div><div>sample of my code:</div><div><br></div><div><br></div><div><div><span style="white-space:pre-wrap;">	</span>Private Sub btnEndActBase_Click(ByVal sender As Object, ByVal args As System.EventArgs)</div><div><span style="white-space:pre-wrap;">		</span>&#39; ** Place Event Handling Code Here **</div><div><span style="white-space:pre-wrap;">	</span>If edvLaborDtl.dataView.Count &gt; 0 Then</div><div><span style="white-space:pre-wrap;">		</span>Dim vLaborHedSeq As String = edvLaborDtl.dataView(edvLaborDtl.Row)(&quot;LaborHedSeq&quot;).tostring</div><div><span style="white-space:pre-wrap;">		</span>Dim vLaborDtlSeq As String = edvLaborDtl.dataView(edvLaborDtl.Row)(&quot;LaborDtlSeq&quot;).tostring</div><div><span style="white-space:pre-wrap;">		</span>ProcessCaller.LaunchForm(MESMenu,&quot;UDEndAct&quot;, vLaborHedSeq + &quot;,&quot; + vLaborDtlSeq )</div><div><span style="white-space:pre-wrap;">	</span>End If</div><div><span style="white-space:pre-wrap;">	</span>End Sub</div></div><div><br></div><p></p>

</div>
 


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

Did this work?

On Oct 26, 2015 10:41 AM, "Jose Gomez" <jose@...> wrote:
Invoke this after your ProcessCaller
this.RefreshLaborData();


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Mon, Oct 26, 2015 at 10:37 AM, jarradlayne@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Let me try to better explain my issue:</p><div><br></div><div>The user clocks into a job, once the person clocks into a job it appears in the Production tab&#39;s grid on the MES main screen.</div><div><br></div><div>Now the user clicks on the job they are clocking out on inside the grid highlighting it and clicks the End Activity button. When the user does this it launches a separate screen, the end activity screen, here the user enters their information and clicks okay. </div><div><br></div><div>When the user clicks &quot;OK&quot; in the End Activity screen what SHOULD happen is the End Activity screen closes and the job that was highlighted is removed from the grid. This does happen with the out of the box End Activity Button. However my customization is the addition of another button that calls the End Activity screen, its using the Process Caller to call a menu ID I made that is the base End Activity. When I use my button it launches the End Activity form for the Job highlighted but when I click &quot;OK&quot; it closes the form but does not update the grid and remove the job. If I close the form and re-open it, the job is gone. So the only issue is the grid isn&#39;t updating. I&#39;ve put oTrans.Refresh() and oTrans.NotifyAll() and that hasn&#39;t help, I think this is because it needs to be triggered off of the close of the End Activity form, if I put it below my code now in the click event it happens before the data is entered.</div><div><br></div><div>sample of my code:</div><div><br></div><div><br></div><div><div><span style="white-space:pre-wrap;">	</span>Private Sub btnEndActBase_Click(ByVal sender As Object, ByVal args As System.EventArgs)</div><div><span style="white-space:pre-wrap;">		</span>&#39; ** Place Event Handling Code Here **</div><div><span style="white-space:pre-wrap;">	</span>If edvLaborDtl.dataView.Count &gt; 0 Then</div><div><span style="white-space:pre-wrap;">		</span>Dim vLaborHedSeq As String = edvLaborDtl.dataView(edvLaborDtl.Row)(&quot;LaborHedSeq&quot;).tostring</div><div><span style="white-space:pre-wrap;">		</span>Dim vLaborDtlSeq As String = edvLaborDtl.dataView(edvLaborDtl.Row)(&quot;LaborDtlSeq&quot;).tostring</div><div><span style="white-space:pre-wrap;">		</span>ProcessCaller.LaunchForm(MESMenu,&quot;UDEndAct&quot;, vLaborHedSeq + &quot;,&quot; + vLaborDtlSeq )</div><div><span style="white-space:pre-wrap;">	</span>End If</div><div><span style="white-space:pre-wrap;">	</span>End Sub</div></div><div><br></div><p></p>

</div>
 


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

Hello Jose,

I've tried this and everything complies fine, but the grid does not refresh when I test it.

Code Used:

Me.oTrans.RefreshLaborData()
 
That's odd... that works everywhere I've tried, are you certain your job is getting ended properly?


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Thu, Oct 29, 2015 at 10:25 AM, jarradlayne@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Hello Jose,</p><div><br></div><div>I&#39;ve tried this and everything complies fine, but the grid does not refresh when I test it.</div><div><br></div><div>Code Used:</div><div><br></div><div>Me.oTrans.<span style="color:rgb(63,63,63);font-family:verdana, sans-serif;font-size:13px;word-spacing:normal;">RefreshLaborData()</span></div><div>Â </div><p></p>

</div><span class="ygrps-yiv-508604384">
 


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


When I do the same steps with the out of the box End Activity Screen as opposed to my newly made button the job is removed from the grid.

It appears that the code is happening before I go into the End Activity screen and click "OK", like it is updating the grid right after the end activity screen is called, not after the "Ok" button is clicked, so its updating the grid while i'm still clocked into the job.
No it definitely happens after you click the ok button I looked at the code.Â
This is the exact code that Epicor (Native) runs
public void EndActivity()
{
  if (this.LaborDtlView.HasRow)
  {
    string str = this.LaborDtlView.dataView[this.LaborDtlView.Row]["LaborHedSeq"].ToString();
    string str2 = this.LaborDtlView.dataView[this.LaborDtlView.Row]["laborDtlSeq"].ToString();
    LaunchFormOptions launchObject = new LaunchFormOptions {
      IsModal = true,
      SuppressFormSearch = true,
      ValueIn = str + "," + str2
    };
    ProcessCaller.LaunchForm(this, "Epicor.Mfg.UI.EndActivityEntry", launchObject);
    this.RefreshLaborData();
  }
}

If all you are doing is modifying EndActivity though you could just enter the menu into Process Calling Maintenance and have it always call your customization and you don't have to customize MES


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Thu, Oct 29, 2015 at 10:44 AM, jarradlayne@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>When I do the same steps with the out of the box End Activity Screen as opposed to my newly made button the job is removed from the grid.</p><div><br></div><div>It appears that the code is happening before I go into the End Activity screen and click &quot;OK&quot;, like it is updating the grid right after the end activity screen is called, not after the &quot;Ok&quot; button is clicked, so its updating the grid while i&#39;m still clocked into the job.</div><p></p>

</div><span>
 


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