Creating Adapters in VB.Net- PO Entry

I highly recommend you use the ICE Tools and Customization User guides read them cover to cover, then I suggest you have your company pay for some training both for general development and a course or two with Epicor itself to learn how to customize the tool
As much as I can appreciate trying to go it alone , Epicor Framework is HUGE and .NET is HUGE and without having a solid understand of at least 1 of those areas its really hard for us to help you other than give you snippets of code and let you run with it.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Thu, Jun 2, 2016 at 3:11 PM, mansler88@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>I feel I should reiterate; </p><div><br></div><div>I have had no one to teach me anything about customizations within Vantage, and the minuscule amount I actually understand about programming has been self taught through online videos about the basics of VB.Net programming, and dissecting other people&#39;s code (which has proven to be really hard to get my hands on, especially when Epicor support almost always gives me code that is nowhere near related to what I am inquiring about, and you can&#39;t really find any information for Epicor products outside of this site, or going through Epicor support). </div><div><br></div><div>My predecessor/trainer was amazing with all of the reporting tools, but she never touched any of the customizations to any menu herself, just some minor form changes, and configured a few BPMs. So I kind of need the &quot;idiots guide to building adapters&quot;, as I have no references for what I am doing, except for the &quot;Epicor Tools User Guide&quot; which doesn&#39;t give an understanding of how to configure Adapters, Assembly References, FKV&#39;s, or really anything to do with the programming of customizations. </div><p></p>

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


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


Hello,

I have been unsuccessfully trying to configure an Adapter on the PO Entry screen, to compare a field to the UD03 table Key1 field, and return the UD03.character01 value, however, I keep running into the error "Type 'UD03AdapterBusinessObject' is not defined". I suspect I am going about this completely wrong, as I am still new to programming, and don't have anyone I work with or know that programs in this VB.Net, to help tell me what I am doing wrong.

    

Dim edvPORel as EpiDataView = CType(oTrans.EpiDataViews("PORel"), EpiDataView)

    Dim DispAcct as String = edvPORel.dataview(edvPORel.Row)("ExpAccountDisplayAccount")

        Dim UD03Adap As UD03AdapterBusinessObject = New UD03AdapterBusinessObject("UD03")

UD03Adap.BOConnect()

    Dim edvUD03 as EpiDataView = CType(oTrans.EpiDataViews("UD03Adap"), EpiDataView)

    Dim TransAcct as String = edvUD03.dataview(edvUD03.Row)("Key1")

    Dim OracAcct as String = edvUD03.dataview(edvUD03.Row)("Character01")

    Dim TextBox as String = edvPORel.dataview(edvPORel.Row)("Character01")

    If DispAcct = TransAcct then

    TextBox = OracAcct

    End If



Does anyone have any advice, or code performing something similar, they would be willing to let me reverse engineer?


Are you just trying to get a matching value out of UD03 to Match some value in PO? I recommend you use a FKV it will save you loads of time and code.
For what its worth there is no object called UD03AdapterBusinessObeject... not sure where that came from? It should just be UD03Adapter.

What version are you on? If 9 or 10 you should try and go the route of C# and not VB since you are learning anyways learn the "better" (yes I said better send hate mail if you'd like) way of doing things.



Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Thu, May 26, 2016 at 4:54 PM, mansler88@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><p><span>Hello,</span></p><p><span>I have been unsuccessfully trying to configure an Adapter on the PO Entry screen, to compare a field to the UD03 table Key1 field, and return the UD03.character01 value, however, I keep running into the error &quot;Type &#39;UD03AdapterBusinessObject&#39; is not defined&quot;. I suspect I am going about this completely wrong, as I am still new to programming, and don&#39;t have anyone I work with or know that programs in this VB.Net, to help tell me what I am doing wrong.</span></p><p>Â  Â Â </p><p><span style="white-space:pre-wrap;">	</span>Dim edvPORel as EpiDataView = CType(oTrans.EpiDataViews(&quot;PORel&quot;), EpiDataView)</p><p>Â  Â  <span style="white-space:pre-wrap;">	</span>Dim DispAcct as String = edvPORel.dataview(edvPORel.Row)(&quot;ExpAccountDisplayAccount&quot;)</p><p>Â  Â  Â  Â  Dim UD03Adap As UD03AdapterBusinessObject = New UD03AdapterBusinessObject(&quot;UD03&quot;)</p><p>UD03Adap.BOConnect()</p><p>Â  Â  <span style="white-space:pre-wrap;">	</span>Dim edvUD03 as EpiDataView = CType(oTrans.EpiDataViews(&quot;UD03Adap&quot;), EpiDataView)</p><p>Â  Â  <span style="white-space:pre-wrap;">	</span>Dim TransAcct as String = edvUD03.dataview(edvUD03.Row)(&quot;Key1&quot;)</p><p>Â  Â  <span style="white-space:pre-wrap;">	</span>Dim OracAcct as String = edvUD03.dataview(edvUD03.Row)(&quot;Character01&quot;)</p><p>Â  Â  <span style="white-space:pre-wrap;">	</span>Dim TextBox as String = edvPORel.dataview(edvPORel.Row)(&quot;Character01&quot;)</p><p>Â  Â  If DispAcct = TransAcct then</p><p>Â  Â  TextBox = OracAcct</p><p>Â  Â  End If</p><p><br></p><p><br></p><p>Does anyone have any advice, or code performing something similar, they would be willing to let me reverse engineer?</p><p><span><br></span></p><p></p>

</div>
 


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

Thanks for the quick response Jose,
Would the FKV work, with me wanting to compare a field from PO Entry, to the Primary Key of UD03, and return the Character01 for the Primary Key? To answer your version question, we're on 8.03, so vb.net is my only choice of languages (believe me, I already know i'd prefer to learn this in C#, lol)

Also, I got the UD03AdapterBusinessObeject from the Objects explorer.
 

Ryan Holt
ERP Systems Admin
It should work just fine if it finds a match between the two columns, your entire UD03 dataset will be available for you to use. If you’re set on using code, I would simplify your approach since you’re only bringing back one field you really don’t need an entire view to store it, just assign it to a UD field in your PO header, line etc.. Code below shows an example of how to do a simple GetByID method to a UD form using an adapter


Module script
Private adaptUD06 As UD06Adapter


Private Sub UDrecord ()
Dim edvPODetail As EpiDataView = CType(oTrans.EpiDataViews("PODetail"), EpiDataView)
Dim strPart As String = edvPODetail.DataView(edvPODetail.Row)("PartNum")
Dim adaptUD06 As UD06Adapter = New UD06Adapter(POEntryForm)
adaptUD06.BOConnect()

Try
Dim recUD06 As Boolean = adaptUD06.GetByID(strPart,"","","","")
edvPODetail.dataView(edvPODetail.Row)("SomePOUDField") = adaptUD06.UD06Data.UD06(0)("Character01" )
Catch e As Exception
‘This will catch a no record found scenario, handle it as you will
Finally
adaptUD06.dispose()
End Try

End Sub


Rob Bucek
Production Control Manager
D&S Manufacturing
301 E. Main St. | PO Box 279
Black River Falls, WI 54615
715-284-5376 Ext. 311
Mobile: 715-896-3119
rbucek@...<mailto:rbucek@...>
Visit our newly redesigned Website at www.dsmfg.com<http://www.dsmfg.com/>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, May 26, 2016 4:16 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Creating Adapters in VB.Net- PO Entry



Thanks for the quick response Jose,
Would the FKV work, with me wanting to compare a field from PO Entry, to the Primary Key of UD03, and return the Character01 for the Primary Key? To answer your version question, we're on 8.03, so vb.net is my only choice of languages (believe me, I already know i'd prefer to learn this in C#, lol)

Also, I got the UD03AdapterBusinessObeject from the Objects explorer.


Ryan Holt
ERP Systems Admin



[Non-text portions of this message have been removed]
Thanks for the information Rob! Sorry, it's been a busy week, so I hadn't had time to work on this customization until yesterday.

I tried doing it with the FKV, however it wasn't giving me the columns I needed, to be able to link to my UD table, so I am trying to do this as the coding route, however I am running into one issue, that due to my inexperience, I don't quite understand what information I need to give it. 

I am getting the error  
"Error: BC30002 - line 150 (171) - Type 'UD03Adapter' is not defined."

which is "Private adaptUD03 As UD03Adapter"

What would be the variable I would want to define this? I have been trying to figure it out, but I've been unsuccessful thus far..


 
You'll need to bring in the UD03 Adapter using the Reference's Dialog in the Tools Menu.Â


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Thu, Jun 2, 2016 at 11:32 AM, mansler88@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Thanks for the information Rob! Sorry, it&#39;s been a busy week, so I hadn&#39;t had time to work on this customization until yesterday.</p><div><br></div><div>I tried doing it with the FKV, however it wasn&#39;t giving me the columns I needed, to be able to link to my UD table, so I am trying to do this as the coding route, however I am running into one issue, that due to my inexperience, I don&#39;t quite understand what information I need to give it. </div><div><br></div><div>I am getting the error  </div><div>&quot;<span style="word-spacing:normal;">Error: BC30002 - line 150 (171) - Type &#39;UD03Adapter&#39; is not defined.&quot;</span></div><div><span style="word-spacing:normal;"><br></span></div><div><span style="word-spacing:normal;">which is &quot;Private adaptUD03 As UD03Adapter&quot;</span></div><div><span style="word-spacing:normal;"><br></span></div><div><span style="word-spacing:normal;">What would be the variable I would want to define this? I have been trying to figure it out, but I&#39;ve been unsuccessful thus far..</span></div><div><br></div><div><br></div><div> </div><p></p>

</div>
 


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

I feel I should reiterate; 

I have had no one to teach me anything about customizations within Vantage, and the minuscule amount I actually understand about programming has been self taught through online videos about the basics of VB.Net programming, and dissecting other people's code (which has proven to be really hard to get my hands on, especially when Epicor support almost always gives me code that is nowhere near related to what I am inquiring about, and you can't really find any information for Epicor products outside of this site, or going through Epicor support). 

My predecessor/trainer was amazing with all of the reporting tools, but she never touched any of the customizations to any menu herself, just some minor form changes, and configured a few BPMs. So I kind of need the "idiots guide to building adapters", as I have no references for what I am doing, except for the "Epicor Tools User Guide" which doesn't give an understanding of how to configure Adapters, Assembly References, FKV's, or really anything to do with the programming of customizations. 
You're not alone when it comes to understanding "adapters".  I too would love an "Idiots guide" 

Have you downloaded the Customization user guide?

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, June 02, 2016 3:12 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Creating Adapters in VB.Net- PO Entry

 



I feel I should reiterate; 

 

I have had no one to teach me anything about customizations within Vantage, and the minuscule amount I actually understand about programming has been self taught through online videos about the basics of VB.Net programming, and dissecting other people's code (which has proven to be really hard to get my hands on, especially when Epicor support almost always gives me code that is nowhere near related to what I am inquiring about, and you can't really find any information for Epicor products outside of this site, or going through Epicor support). 

 

My predecessor/trainer was amazing with all of the reporting tools, but she never touched any of the customizations to any menu herself, just some minor form changes, and configured a few BPMs. So I kind of need the "idiots guide to building adapters", as I have no references for what I am doing, except for the "Epicor Tools User Guide" which doesn't give an understanding of how to configure Adapters, Assembly References, FKV's, or really anything to do with the programming of customizations.