# MES FKV to show operation comment text

**URL:** <https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171>\
**Category:** Epicor ERP 10\
**Created:** [September 26, 2018, 3:23pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171 "2018-09-26T15:23:05Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [September 27, 2018, 4:00pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/21 "2018-09-27T16:00:47Z")

</div>

I missed that! I will try it.

---

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [September 27, 2018, 4:35pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/22 "2018-09-27T16:35:54Z")

</div>

When the code runs, it says that there is no row at position 0.

```
private void LaborDtl_AfterRowChange(EpiRowChangedArgs args)
{
// **Argument Properties and Uses**
// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
// args.LastRow, args.CurrentRow, args.CurrentView
// Add Event Handler Code
JobOperSearchAdapter adapterJobOperSearch = new JobOperSearchAdapter(oTrans);
adapterJobOperSearch.BOConnect();
var row = adapterJobOperSearch.JobOperSearchData.JobOper.Rows[0];
string job1 = row["JobNum"].ToString();
MessageBox.Show(job1);
adapterJobOperSearch.Dispose();
}
```

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [September 27, 2018, 4:47pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/23 "2018-09-27T16:47:42Z")

</div>

You connected the adapter, but you still have to run a lookup of some sort. (like GetByID or something)

---

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [September 27, 2018, 5:02pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/24 "2018-09-27T17:02:59Z")

</div>

I guess I’m lost…if GetByID returns a boolean, that seems more like a verification to me, not something that would provide information that is required for Chris’ code to run.

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [September 27, 2018, 5:15pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/25 "2018-09-27T17:15:06Z")

</div>

GetByID populates the internal dataset of the adapter: adapterJobOperSearch.JobOperSearchData

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [September 27, 2018, 5:17pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/26 "2018-09-27T17:17:46Z")

</div>

> [@fredmeissner](#):
>
> if GetByID returns a boolean,

If you just ask for the adapter to come back as a string, you get the boolean. If you reference the rows, like you have, you will get the rows.

Just add adapterJobOperSearch.GetByID(yourjobnumber); in front of your “var row” line.

---

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [September 27, 2018, 6:01pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/27 "2018-09-27T18:01:47Z")

</div>

I am still getting the no row error.

```
private void LaborDtl_AfterRowChange(EpiRowChangedArgs args)
{
	// **Argument Properties and Uses**
	// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
	// args.LastRow, args.CurrentRow, args.CurrentView
	// Add Event Handler Code
	var view = ((EpiDataView)(this.oTrans.EpiDataViews["LaborDtl"]));
	string job = view.dataView[view.Row]["JobNum"].ToString();
	JobOperSearchAdapter adapterJobOperSearch = new JobOperSearchAdapter(oTrans);
	adapterJobOperSearch.BOConnect();
	adapterJobOperSearch.GetByID(job);
	var row = adapterJobOperSearch.JobOperSearchData.JobOper.Rows[0];
	string job1 = row["JobNum"].ToString();
	MessageBox.Show(job1);
	adapterJobOperSearch.Dispose();
}
```

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [September 27, 2018, 6:34pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/28 "2018-09-27T18:34:56Z")

</div>

First before you check the row, ensure the GetByID is returning true.

Second, make a BAQ against the JobOper table and query for that job# and ensure that there is in fact a JobOper there

---

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [September 27, 2018, 6:43pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/29 "2018-09-27T18:43:46Z")

</div>

I am getting a true value for `GetByID(job)`, and the BAQ shows records for the job.

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [September 27, 2018, 6:53pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/30 "2018-09-27T18:53:00Z")

</div>

Ah, i believe this might be the issue… Looks like the GetByID for that adapter requires three params

![image](https://epiusers.help/uploads/default/original/2X/2/26628d5969dccd7e03277d5533a1160e6dc4aeb7.png)  
which translates to:  
 ![image](https://epiusers.help/uploads/default/original/2X/d/decc500aa9417c919da97803eec620516cfd9cf9.png)

So to use the GetByID on that particular adapter, you need something like:  
adapter.GetByID(new object[]{“job”,assySeq, opSeq});

if you need something more flexible, you might consider a GetRows with a whereclause

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [September 27, 2018, 6:57pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/31 "2018-09-27T18:57:15Z")

</div>

> [@Chris\_Conn](#):
>
> if you need something more flexible, you might consider a GetRows with a whereclause

Teach us how to use that master!!

---

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [September 27, 2018, 7:00pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/32 "2018-09-27T19:00:30Z")

</div>

This is exactly what I need, the only issue I’m having is converting AssemblySeq and OprSeq to integers. Example: `int asm = view.dataView[view.Row]["AssemblySeq"].???`

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [September 27, 2018, 7:00pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/33 "2018-09-27T19:00:31Z")

</div>

```cs
SearchOptions optsTrans = new SearchOptions(SearchMode.AutoSearch); 
optsTrans.PageSize = 100; //return this many (can call more later)
string whereTrans = string.Format("JobNum = '{0}'" , JobEdit.Text); 
optsTrans.NamedSearch.WhereClauses.Add("JobOper",whereTrans); 
var trans =myAdapter.GetRows(optsTrans,out more);

```

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [September 27, 2018, 7:00pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/34 "2018-09-27T19:00:53Z")

</div>

int asm = (int)view.dataView[view.Row][“AssemblySeq”];

---

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [September 27, 2018, 7:07pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/35 "2018-09-27T19:07:02Z")

</div>

It’s working! Thank you so much!

---

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [October 1, 2018, 7:00pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/36 "2018-10-01T19:00:59Z")

</div>

I’m going to open this one up again…an issue I’ve noticed is that because it’s triggered by AfterRowChange, it won’t work if there is only one row (one job clocked in).

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [October 1, 2018, 8:28pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/37 "2018-10-01T20:28:44Z")

</div>

Maybe you could add another condition to handle when the first row is added. You could use EpiViewNotification event. Condition AddRow event and a RowCount = 1

---

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [October 2, 2018, 2:18pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/38 "2018-10-02T14:18:15Z")

</div>

I’ve grappled with this for a while now, looking at quite a few threads, and I’m not sure how to get the RowCount. It looks like it’s an attribute of the DataView, but not sure on the syntax.

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [October 2, 2018, 2:31pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/39 "2018-10-02T14:31:05Z")

</div>

view.dataView.Count

---

<div class="post-metadata">

**Author:** ![fredmeissner](https://www.epiusers.help/user_avatar/www.epiusers.help/fredmeissner/32/58009_2.png) [@fredmeissner](https://www.epiusers.help/u/fredmeissner)\
**Post date:** [October 2, 2018, 2:48pm UTC](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171/40 "2018-10-02T14:48:52Z")

</div>

Hmmmm…the code is compiling, but it’s not triggering when I clock in to a job, and it’s not triggering if I login when there is a job already clocked in. Is there an event that fires when a row is clicked, even if it doesn’t change?

I ran a check on MESMenu\_Load and the message box isn’t showing up.

```
var view = ((EpiDataView)(this.oTrans.EpiDataViews["LaborDtl"]));
if (view.dataView.Count == 1)
{
	MessageBox.Show("!!!");
}
```

[Previous page](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171.md?page=1)

[Next page](https://www.epiusers.help/t/mes-fkv-to-show-operation-comment-text/48171.md?page=3)
