Adapter in customization

Lately I've been doing more with BPM's but that's just because of what
I've been working on. VB scripts are still very appropriate solutions
depending on what you're trying to accomplish, as well as where you're
experience and comfort level is as well. If you're ever curious as to
what row may in in focus just use a message box to show a particular
field. If youre checking for a row Ive usually done that during the
EpiViewNotification for example..



If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then

If (args.Row > -1) Then

If (lastAdapterMethod = "GetNewShpClass")

I'm still a total noob at VB though...

Rob Bucek

Manufacturing Engineer

PH: (715) 284-5376 ext 3111

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of k_stump
Sent: Friday, October 23, 2009 11:23 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: adapter in customization





Thank you so much !
I think you are right that I was checking before those changes had been
made. (I still wonder how to tell in an epiview if the row is really
there ! )
So in this example, by looking at my first field after a user has tabbed
off of it I can do the logic at the correct time.
I was trying to do this edit in VB instead of a BPM since this is the
only place I need to check it.
Do you do more with BPM's than VB edits?

This really helps !
Thanks again !

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Rob
Bucek" <rbucek@...> wrote:
>
> Kristi,
>
>
>
> Im not the foremost expert on VB customizations, but, there have been
> many times I have run across forms that a certain adapter method is
> either not used, or is not able to be seen in the same manner as a lot
> of other forms. I haven't don't too much with order entry so im not
> sure what the norm is but personally I couldn't get any method to show
> up. Here is a suggestion which I think could work for you.
>
>
>
> Private Sub nedEpiCustom1_LostFocus(ByVal Sender As Object, ByVal Args
> As System.EventArgs) Handles nedEpiCustom1.LostFocus
>
> '// ** Place Event Handling Code Here **
>
> Dim intNumber4 As EpiNumericEditor =
>
ctype(csm.GetNativeControlReference("1fca3e88-1d5d-4b9f-8658-189c5a526cd
> c"),EpiNumericEditor)
>
> 'messagebox.show(intnumber4.tostring)
>
> If intNumber4.value > 0 Then
>
> 'Dim strGroup as String
>
> Dim strGroup As EpiTextBox =
>
ctype(csm.GetNativeControlReference("286536f5-64a6-433b-bb7d-3d1e8161013
> a"),EpiTextBox)
>
> 'args.Cancel = False
>
> if strGroup.text = "" Then
>
> messagebox.show("Must select SDA/Concession type")
>
> ' Cancel the update
>
> 'args.Cancel = True
>
> End If
>
> End if
>
> End Sub
>
>
>
> I tested this out, it does work. Part of the problem with your other
> code was that you were looking to the tables/fields, perhaps before
the
> changes would have even been made (i.e. before adapter...update) so
the
> conditions may have never been met because of timing. In the past if I
> wanted to validate any data an user was inputing I would look to the
> field in the form before it ever went to the database. With my above
> example, you could change LostFocus to ValueChanged..there are a few
> different ways to get this done.
>
>
>
> Youll want to change the EpiGuid
'1fca3e88-1d5d-4b9f-8658-189c5a526cdc'
> to that of your actual field in use (Number04) as well as the name of
> your field (I used nedEpiCustom1), yours may be different.
>
>
>
> Rob Bucek
>
> Manufacturing Engineer
>
> PH: (715) 284-5376 ext 3111
>
> FAX: (715)284-4084
>
> <http://www.dsmfg.com/>
>
> (Click the logo to view our site) <http://www.dsmfg.com/>
>
>
>
>
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
> Of k_stump
> Sent: Friday, October 23, 2009 6:59 AM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] Re: adapter in customization
>
>
>
>
>
> Hi Rob,
> I am in Sales Order Entry. I have two UD fields. If one is entered,
the
> other one has to be entered. also.
>
>
> Private Sub oTrans_ordAdapter_BeforeAdapterMethod(ByVal sender As
> Object, ByVal args As BeforeAdapterMethodArgs)
> '** Argument Properties and Uses **
> '** args.MethodName **
> '** Add Event Handler Code **
>
> '** Use MessageBox to find adapter method name
> 'EpiMessageBox.Show(args.MethodName)
>
> Select Case args.MethodName
>
> Case "Update"
> Dim edv as EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"),
> EpiDataView)
> If edv.dataView(edv.Row)("Number04") > 0 Then
> Dim strGroup as String
> strGroup = edv.dataView(edv.row)("ShortChar01").ToString()
> args.Cancel = False
> if strGroup.Length = 0 Then
> call messagebox.show("Must select SDA/Concession type")
> ' Cancel the update
> args.Cancel = True
> End If
> End if
> Case Else
> End Select
>
> End Sub
>
>
>
>
>
> [Non-text portions of this message have been removed]
>





[Non-text portions of this message have been removed]
Hi,
I am trying to do a customization, and using an before adapter method.
oTrans_ordAdapter_BeforeAdapterMethod

How can I tell if I have the orderdtl from the epidataview?
I am lost !
Thanks
Kristi
What form are you in? What are you trying to accomplish? What's your
code so far?



Rob Bucek

Manufacturing Engineer

PH: (715) 284-5376 ext 3111

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of k_stump
Sent: Thursday, October 22, 2009 4:58 PM
To: vantage@yahoogroups.com
Subject: [Vantage] adapter in customization





Hi,
I am trying to do a customization, and using an before adapter method.
oTrans_ordAdapter_BeforeAdapterMethod

How can I tell if I have the orderdtl from the epidataview?
I am lost !
Thanks
Kristi





[Non-text portions of this message have been removed]
Hi Rob,
I am in Sales Order Entry. I have two UD fields. If one is entered, the other one has to be entered. also.


Private Sub oTrans_ordAdapter_BeforeAdapterMethod(ByVal sender As Object, ByVal args As BeforeAdapterMethodArgs)
'** Argument Properties and Uses **
'** args.MethodName **
'** Add Event Handler Code **

'** Use MessageBox to find adapter method name
'EpiMessageBox.Show(args.MethodName)

Select Case args.MethodName

Case "Update"
Dim edv as EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"), EpiDataView)
If edv.dataView(edv.Row)("Number04") > 0 Then
Dim strGroup as String
strGroup = edv.dataView(edv.row)("ShortChar01").ToString()
args.Cancel = False
if strGroup.Length = 0 Then
call messagebox.show("Must select SDA/Concession type")
' Cancel the update
args.Cancel = True
End If
End if
Case Else
End Select

End Sub
Kristi,



Im not the foremost expert on VB customizations, but, there have been
many times I have run across forms that a certain adapter method is
either not used, or is not able to be seen in the same manner as a lot
of other forms. I haven't don't too much with order entry so im not
sure what the norm is but personally I couldn't get any method to show
up. Here is a suggestion which I think could work for you.



Private Sub nedEpiCustom1_LostFocus(ByVal Sender As Object, ByVal Args
As System.EventArgs) Handles nedEpiCustom1.LostFocus

'// ** Place Event Handling Code Here **

Dim intNumber4 As EpiNumericEditor =
ctype(csm.GetNativeControlReference("1fca3e88-1d5d-4b9f-8658-189c5a526cd
c"),EpiNumericEditor)

'messagebox.show(intnumber4.tostring)

If intNumber4.value > 0 Then

'Dim strGroup as String

Dim strGroup As EpiTextBox =
ctype(csm.GetNativeControlReference("286536f5-64a6-433b-bb7d-3d1e8161013
a"),EpiTextBox)

'args.Cancel = False

if strGroup.text = "" Then

messagebox.show("Must select SDA/Concession type")

' Cancel the update

'args.Cancel = True

End If

End if

End Sub



I tested this out, it does work. Part of the problem with your other
code was that you were looking to the tables/fields, perhaps before the
changes would have even been made (i.e. before adapter...update) so the
conditions may have never been met because of timing. In the past if I
wanted to validate any data an user was inputing I would look to the
field in the form before it ever went to the database. With my above
example, you could change LostFocus to ValueChanged..there are a few
different ways to get this done.



Youll want to change the EpiGuid '1fca3e88-1d5d-4b9f-8658-189c5a526cdc'
to that of your actual field in use (Number04) as well as the name of
your field (I used nedEpiCustom1), yours may be different.



Rob Bucek

Manufacturing Engineer

PH: (715) 284-5376 ext 3111

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of k_stump
Sent: Friday, October 23, 2009 6:59 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: adapter in customization





Hi Rob,
I am in Sales Order Entry. I have two UD fields. If one is entered, the
other one has to be entered. also.


Private Sub oTrans_ordAdapter_BeforeAdapterMethod(ByVal sender As
Object, ByVal args As BeforeAdapterMethodArgs)
'** Argument Properties and Uses **
'** args.MethodName **
'** Add Event Handler Code **

'** Use MessageBox to find adapter method name
'EpiMessageBox.Show(args.MethodName)

Select Case args.MethodName

Case "Update"
Dim edv as EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"),
EpiDataView)
If edv.dataView(edv.Row)("Number04") > 0 Then
Dim strGroup as String
strGroup = edv.dataView(edv.row)("ShortChar01").ToString()
args.Cancel = False
if strGroup.Length = 0 Then
call messagebox.show("Must select SDA/Concession type")
' Cancel the update
args.Cancel = True
End If
End if
Case Else
End Select

End Sub





[Non-text portions of this message have been removed]
Thank you so much !
I think you are right that I was checking before those changes had been made. (I still wonder how to tell in an epiview if the row is really there ! )
So in this example, by looking at my first field after a user has tabbed off of it I can do the logic at the correct time.
I was trying to do this edit in VB instead of a BPM since this is the only place I need to check it.
Do you do more with BPM's than VB edits?

This really helps !
Thanks again !


--- In vantage@yahoogroups.com, "Rob Bucek" <rbucek@...> wrote:
>
> Kristi,
>
>
>
> Im not the foremost expert on VB customizations, but, there have been
> many times I have run across forms that a certain adapter method is
> either not used, or is not able to be seen in the same manner as a lot
> of other forms. I haven't don't too much with order entry so im not
> sure what the norm is but personally I couldn't get any method to show
> up. Here is a suggestion which I think could work for you.
>
>
>
> Private Sub nedEpiCustom1_LostFocus(ByVal Sender As Object, ByVal Args
> As System.EventArgs) Handles nedEpiCustom1.LostFocus
>
> '// ** Place Event Handling Code Here **
>
> Dim intNumber4 As EpiNumericEditor =
> ctype(csm.GetNativeControlReference("1fca3e88-1d5d-4b9f-8658-189c5a526cd
> c"),EpiNumericEditor)
>
> 'messagebox.show(intnumber4.tostring)
>
> If intNumber4.value > 0 Then
>
> 'Dim strGroup as String
>
> Dim strGroup As EpiTextBox =
> ctype(csm.GetNativeControlReference("286536f5-64a6-433b-bb7d-3d1e8161013
> a"),EpiTextBox)
>
> 'args.Cancel = False
>
> if strGroup.text = "" Then
>
> messagebox.show("Must select SDA/Concession type")
>
> ' Cancel the update
>
> 'args.Cancel = True
>
> End If
>
> End if
>
> End Sub
>
>
>
> I tested this out, it does work. Part of the problem with your other
> code was that you were looking to the tables/fields, perhaps before the
> changes would have even been made (i.e. before adapter...update) so the
> conditions may have never been met because of timing. In the past if I
> wanted to validate any data an user was inputing I would look to the
> field in the form before it ever went to the database. With my above
> example, you could change LostFocus to ValueChanged..there are a few
> different ways to get this done.
>
>
>
> Youll want to change the EpiGuid '1fca3e88-1d5d-4b9f-8658-189c5a526cdc'
> to that of your actual field in use (Number04) as well as the name of
> your field (I used nedEpiCustom1), yours may be different.
>
>
>
> Rob Bucek
>
> Manufacturing Engineer
>
> PH: (715) 284-5376 ext 3111
>
> FAX: (715)284-4084
>
> <http://www.dsmfg.com/>
>
> (Click the logo to view our site) <http://www.dsmfg.com/>
>
>
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of k_stump
> Sent: Friday, October 23, 2009 6:59 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: adapter in customization
>
>
>
>
>
> Hi Rob,
> I am in Sales Order Entry. I have two UD fields. If one is entered, the
> other one has to be entered. also.
>
>
> Private Sub oTrans_ordAdapter_BeforeAdapterMethod(ByVal sender As
> Object, ByVal args As BeforeAdapterMethodArgs)
> '** Argument Properties and Uses **
> '** args.MethodName **
> '** Add Event Handler Code **
>
> '** Use MessageBox to find adapter method name
> 'EpiMessageBox.Show(args.MethodName)
>
> Select Case args.MethodName
>
> Case "Update"
> Dim edv as EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"),
> EpiDataView)
> If edv.dataView(edv.Row)("Number04") > 0 Then
> Dim strGroup as String
> strGroup = edv.dataView(edv.row)("ShortChar01").ToString()
> args.Cancel = False
> if strGroup.Length = 0 Then
> call messagebox.show("Must select SDA/Concession type")
> ' Cancel the update
> args.Cancel = True
> End If
> End if
> Case Else
> End Select
>
> End Sub
>
>
>
>
>
> [Non-text portions of this message have been removed]
>