I've done all kinds of customizations by using adapters, but I've never done one using the dataset for the epidataview.
For example, suppose I'm in Customer Entry and wanted to set up a button that created the CustomerDocs records. Now, I could use the CustomerAdapter, but in doing so, I'm having to call the GetByID to pull the customer into the adapter dataset and then modify the adapter dataset by calling the various methods to get a new customerdocs record, update, etc. Since I'm not using the EpiDataViews, I'd need to issue an otrans.refresh() at the end to display the updated dataaset on the screen. That's a lot of extra calls.
What I'd like to do is use the epiDataView as my dataset and do the same types of method calls. However, I don't know the syntax for doing this. Does anyone have any examples of this in code - doesn't need to be with the Customer entry program.
Thanks in advance.
Kevin Simon
Look in object explorer transaction usually there are available public functIons for adding ties to any table in there.
Then call them as otrans.GetNew...()
Then simply get the data view
Make the changes top it and call o trans.update
On Nov 2, 2013 9:55 PM, <simstrak@...> wrote:Â<div> <p><p>I've done all kinds of customizations by using adapters, but I've never done one using the dataset for the epidataview. </p><p> </p><p>For example, suppose I'm in Customer Entry and wanted to set up a button that created the CustomerDocs records. Now, I could use the CustomerAdapter, but in doing so, I'm having to call the GetByID to pull the customer into the adapter dataset and then modify the adapter dataset by calling the various methods to get a new customerdocs record, update, etc.   Since I'm not using the EpiDataViews, I'd need to issue an otrans.refresh() at the end to display the updated dataaset on the screen. That's a lot of extra calls. </p>
Â
What I'd like to do is use the epiDataView as my dataset and do the same types of method calls. However, I don't know the syntax for doing this. Does anyone have any examples of this in code - doesn't need to be with the Customer entry program.
Â
Thanks in advance.
Â
Kevin Simon
</div> <div style="color:#fff;min-height:0;"></div>
Perfect – thanks. That was easy.
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Jose Gomez
Sent: Sunday, November 03, 2013 8:27 AM
To: Vantage
Subject: Re: [Vantage] Calling Methods using EpiDataView
Look in object explorer transaction usually there are available public functIons for adding ties to any table in there.
Then call them as otrans.GetNew...()
Then simply get the data view
Make the changes top it and call o trans.update
On Nov 2, 2013 9:55 PM, <simstrak@...> wrote:
I've done all kinds of customizations by using adapters, but I've never done one using the dataset for the epidataview.
For example, suppose I'm in Customer Entry and wanted to set up a button that created the CustomerDocs records. Now, I could use the CustomerAdapter, but in doing so, I'm having to call the GetByID to pull the customer into the adapter dataset and then modify the adapter dataset by calling the various methods to get a new customerdocs record, update, etc. Since I'm not using the EpiDataViews, I'd need to issue an otrans.refresh() at the end to display the updated dataaset on the screen. That's a lot of extra calls.
What I'd like to do is use the epiDataView as my dataset and do the same types of method calls. However, I don't know the syntax for doing this. Does anyone have any examples of this in code - doesn't need to be with the Customer entry program.
Thanks in advance.
Kevin Simon
OK, I'm struggling now with one more aspect of this. I've got the following code to create a Misc Charge to an Invoice Line while in Invoice Entry:
Dim edvInvcMisc as EpiDataView = CType(oTrans.EpiDataViews("InvcMisc"), EpiDataView)
oTrans.GetNewInvcMisc()
dim IMRow as integer = edvInvcMisc.DataView.Count - 1
edvInvcMisc.DataView(IMRow)("MiscCode") = "P001"
edvInvcMisc.DataView(IMRow)("MiscCodeDescription") = "Test adding from Code"
edvInvcMisc.DataView(IMRow)("DspDocMiscAmt") = 100
oTrans.Update(true)
The above code works just fine - it adds a misc charge. The problem I'm having now is it adds the Misc Charge to whatever Invoice Detail is the current row. I will actually be going through all of InvcDtl lines and adding charges to some of them. How do I go about changing the current row on the InvcDtl line, so when I call the GetNewInvcMisc method, it does it for whatever invoice I want. I see there's a CurrentRow property as part of the epiDataView properties, but that's read-only field and I can set it. So, what I'm really looking to do is (pseudo code)
for each datarow in InvcDtl...
if (conditions_met) then
set current row to the datarow I'm processing
get New InvcMisc
update fields.
otrans.update()
end if
end if
Thanks in advance!
Kevin Simon
---In vantage@yahoogroups.com, <simstrak@...> wrote:Perfect – thanks. That was easy.
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Jose Gomez
Sent: Sunday, November 03, 2013 8:27 AM
To: Vantage
Subject: Re: [Vantage] Calling Methods using EpiDataView
Look in object explorer transaction usually there are available public functIons for adding ties to any table in there.
Then call them as otrans.GetNew...()
Then simply get the data view
Make the changes top it and call o trans.updateOn Nov 2, 2013 9:55 PM, <simstrak@...> wrote:
I've done all kinds of customizations by using adapters, but I've never done one using the dataset for the epidataview.
For example, suppose I'm in Customer Entry and wanted to set up a button that created the CustomerDocs records. Now, I could use the CustomerAdapter, but in doing so, I'm having to call the GetByID to pull the customer into the adapter dataset and then modify the adapter dataset by calling the various methods to get a new customerdocs record, update, etc. Since I'm not using the EpiDataViews, I'd need to issue an otrans.refresh() at the end to display the updated dataaset on the screen. That's a lot of extra calls.
What I'd like to do is use the epiDataView as my dataset and do the same types of method calls. However, I don't know the syntax for doing this. Does anyone have any examples of this in code - doesn't need to be with the Customer entry program.
Thanks in advance.
Kevin Simon
My thought is that you need to methodically move through each line using something like:
Dim edvInvcDtl as EpiDataView = CType(oTrans.EpiDataViews("InvcDtl"), EpiDataView)
Dim edvInvcMisc as EpiDataView = CType(oTrans.EpiDataViews("InvcMisc"), EpiDataView)
‘For loop through edvInvcDtl
‘setting the textbox of the line to process which will allow you to do a GetNewInvcMisc() on the correct line
“pass the current dtlviews line numberâ€
txtInvcLineField.Text = edvInvcDtl.dataView(edvInvcDtl .Row)(“Whatever the invc line field is calledâ€)
oTrans.ValidateKeyField(THE CONTROL THAT IDENTIFIES THE LINE NUMBER)
oTrans.NotifyAll()
for loop through InvcMisc
oTrans.GetNewInvcMisc()
edvInvcMisc = CType(oTrans.EpiDataViews("InvcMisc"), EpiDataView)
dim IMRow as integer = edvInvcMisc.DataView.Count - 1
edvInvcMisc.DataView(IMRow)("MiscCode") = "P001"
edvInvcMisc.DataView(IMRow)("MiscCodeDescription") = "Test adding from Code"
edvInvcMisc.DataView(IMRow)("DspDocMiscAmt") = 100
oTrans.Update(true)
Next
Next
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
On Behalf Of simstrak@...
Sent: Thursday, November 21, 2013 9:15 AM
To: vantage@yahoogroups.com
Subject: RE: RE: [Vantage] Calling Methods using EpiDataView
OK, I'm struggling now with one more aspect of this. I've got the following code to create a Misc Charge to an Invoice Line while in Invoice Entry:
Dim edvInvcMisc as EpiDataView = CType(oTrans.EpiDataViews("InvcMisc"), EpiDataView)
oTrans.GetNewInvcMisc()
dim IMRow as integer = edvInvcMisc.DataView.Count - 1
edvInvcMisc.DataView(IMRow)("MiscCode") = "P001"
edvInvcMisc.DataView(IMRow)("MiscCodeDescription") = "Test adding from Code"
edvInvcMisc.DataView(IMRow)("DspDocMiscAmt") = 100
oTrans.Update(true)
The above code works just fine - it adds a misc charge. The problem I'm having now is it adds the Misc Charge to whatever Invoice Detail is the current row. I will actually be going through all of InvcDtl lines and adding charges to some of them. How do I go about changing the current row on the InvcDtl line, so when I call the GetNewInvcMisc method, it does it for whatever invoice I want. I see there's a CurrentRow property as part of the epiDataView properties, but that's read-only field and I can set it. So, what I'm really looking to do is (pseudo code)
for each datarow in InvcDtl...
if (conditions_met) then
set current row to the datarow I'm processing
get New InvcMisc
update fields.
otrans.update()
end if
end if
Thanks in advance!
Kevin Simon
---In vantage@yahoogroups.com, <simstrak@...> wrote:
Perfect – thanks. That was easy.
From:
vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
On Behalf Of Jose Gomez
Sent: Sunday, November 03, 2013 8:27 AM
To: Vantage
Subject: Re: [Vantage] Calling Methods using EpiDataView
Look in object explorer transaction usually there are available public functIons for adding ties to any table in there.
Then call them as otrans.GetNew...()
Then simply get the data view
Make the changes top it and call o trans.update
On Nov 2, 2013 9:55 PM, <simstrak@...> wrote:
I've done all kinds of customizations by using adapters, but I've never done one using the dataset for the epidataview.
For example, suppose I'm in Customer Entry and wanted to set up a button that created the CustomerDocs records. Now, I could use the CustomerAdapter, but in doing so, I'm having to call the GetByID to pull the customer into the adapter dataset and then modify the adapter dataset by calling the various methods to get a new customerdocs record, update, etc. Since I'm not using the EpiDataViews, I'd need to issue an otrans.refresh() at the end to display the updated dataaset on the screen. That's a lot of extra calls.
What I'd like to do is use the epiDataView as my dataset and do the same types of method calls. However, I don't know the syntax for doing this. Does anyone have any examples of this in code - doesn't need to be with the Customer entry program.
Thanks in advance.
Kevin Simon