Calling Methods using EpiDataView

This is a timely post, I’m trying to do something similar, but from a CRM Call.  I need to pull the value out of Shortchar05 from HDCase.  Now CRMCall has the HDCaseNum stored in the Key1 field.  How do I go about filtering or finding the correct row in the HDCase dataview to retrieve the ShortChar05 value?
 
Any assistance appreciated.
 
Cheers
Simon Hall

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&#39;ve done all kinds of customizations by using adapters, but I&#39;ve never done one using the dataset for the epidataview. </p><p> </p><p>For example, suppose I&#39;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&#39;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&#39;m not using the EpiDataViews, I&#39;d need to issue an otrans.refresh() at the end to display the updated dataaset on the screen.  That&#39;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.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

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

------------------------------------------------------------------------------------------------------------------------ CONFIDENTIALITY NOTICE: The data attached/enclosed may contain information (including technology and technical data) which is subject to the U.S. International Traffic in Arms Regulations (ITAR) or Export Administration Regulations (EAR). This information may not be exported, released, or disclosed to foreign persons either inside or outside the United States without first obtaining the proper U.S. export license or written authorization. In addition, the information and articles described herein are either patented or proprietary, and the copying or reproduction thereof is prohibited without ADVANCED Motion Controls prior written consent. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Thank you for your compliance. X3BTB534