Populate 'private' fields - customization question

When the order header is started was the original plan. Though I
suppose it probably makes no difference, that's just the way I
approached it.

With the lists help it's now working marvelously. Thanks for all the
tips everyone.

(As for the convert string Michael, that was just me being an
idiot....txtKeyField.Text, I realized it right after I sent my message
of course.)

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Charlie Smith
Sent: Wednesday, January 16, 2008 10:07 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: Populate 'private' fields - customization
question



Just for my information, are you trying to assign the Order number when
the order header is started or when the header is completed? Under
normal circumstances you would get the order number when the header is
saved. I would think you would be able to override the business process
at that point to save the order number the way you want to.

Charlie Smith

2W Technologies LLC / Smith Business Services

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ken Williams
Sent: Wednesday, January 16, 2008 11:29 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Re: Populate 'private' fields - customization
question

Cool, almost there.

I added the two lines, verifying the guid. Now I am having issues with
converting the number.

I've tried cstr among other things and can't get it to take. Regardless
of how I try to convert it I get "Error: BC30311 - line 145 (486) -
Value of type 'Integer' cannot be converted to
'Epicor.Mfg.UI.FrameWork.EpiTextBox'." If I use cstr it says type
'String'. I've tried Chr as well, but I'm sure I need some fancy
ctype(csm.blahblah) that I don't know about. I think this is the last
step, thanks for your help!

(BTW, the reason for this button is we need two seperate order number
strings, refer to the initial e-mail if you're curious for more
details.)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Michael McWilliams
Sent: Wednesday, January 16, 2008 8:52 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Re: Populate 'private' fields - customization
question

I did not know you could assign Sales Order Numbers but try this. It
will allow you to populate the field, not sure how you will be able
to get past that but if you do please let me know how.

'After the begining of the module:

Private WithEvents txtKeyField As EpiTextBox

'Then create an on load event:

txtKeyField = ctype(csm.GetNativeControlReverence(""4fceeeec-518c-
4256-932e-34a4c1a584ee"),EpiTextBox)

'Then set txtKeyField I am not sure if you have to convert your
number to a string or not.

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> , "Ken
Williams" <ken@...> wrote:
>
> Okay, part of the problem I'm having is I'm trying to populate a
field
> before any dataview has been called.
>
> I'm in Order Entry and I'd like to populate the keyfield so when
they
> leave the keyfield it then creates a new SO with that number (same
as if
> you had typed an unused number in).
>
> I tried to create a custom control to populate OrderHed.OrderNum,
but
> that just results in a nice Microsoft .NET Framework crash.
>
> I did notice in the "all code" there is "Private WithEvents
> SalesOrderForm As
Epicor.Mfg.UI.App.SalesOrderEntry.SalesOrderForm" -
> beings it only shows when I select All Code, means I can't edit it
to
> make it public.
>
> Any other ideas?
>
> ________________________________
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
> Of Robert Brown
> Sent: Tuesday, January 15, 2008 3:53 PM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> Subject: Re: [Vantage] Populate 'private' fields - customization
> question
>
>
>
> Try declaring the dataview (containing the field you wish to pop
the
> custom calculated order number into) as Public withEvents instead
of
> Private withEvents.
>
> If that still fails, you are likely getting a (misinterpreted)
error
> message. Most apps seem to (randomly) have at least one field that
the
> native control just refuses to release its grip upon - so you can't
> directly reference it in a subroutine and update it.
>
> To get around that, assign an appropriate custom control from the
> toolbox to the field and have your Sub pass the value to the new
custom
> control (with can be hidden). That new custom control will then
set the
> field you are trying to update (without interference from the
native
> control).
>
> If THAT fails, set the custom control to a free (appropriate type)
user
> definable field in the same EpiDataView table as your target
field. You
> should then be able to set the edvTable(field) = to your
> edvTable(udfield).
>
> No idea why such machinations are sometimes required (and don't
care). I
> just know one of the 3 methods above eventually works. I suspect
the
> event trigger for the Sub doing the updating bears some
responsibility
> as to which one ends up working - as well as possibly also being a
> contributing reason as to why the native control bound to the field
> sometimes 'gets in the way'.
>
> Rob Brown
>
> Ken Williams <ken@...
> <mailto:ken%40intermountainelectronics.com> > wrote:
> We have two seperate lines of order numbers we've been using and
would
> like to continue to use. We did this originally as we had pre-
printed
> tags labeled 1000-9999 for repair work that we used as the SO
number,
> and we use the system generated ones for all other SO numbers.
We're
> reaching the end of our pre-printed tags and we'll now be printing
a
> barcode label for these, but we'd like to have them starting at
10000
> and moving forward, our system generated SOs start at 80000 so we
have a
> long time before they collide.
>
> So, I setup a push button on the Order Entry screen and have come
up
> with the following code:
>
> dim ordernum as integer = 9999
> dim recSelected as boolean = true
> while recSelected
> ordernum=ordernum+1
> Dim whereClause as string = "OrderNum = '" & ordernum & "'"
> Dim dsOrderNum as DataSet =
> Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
(oTrans,"SalesOrde
> rAdapter",recSelected,False,whereClause)
> end while
>
> messagebox.show(ordernum)
>
> This works extremely well, but instead of just showing a message
box
> with the number, I'd like it to put this into the empty SO field
> automatically. According to customization this field is
> SalesOrderForm.sheetTopLevelPanel1.summaryPanel1.txtKeyField. If I
try
> to set this field = ordernum, I get a compiler error that the
field "is
> not accessible in this context because it is 'Private'". Is what
I'm
> asking for possible? Is there away around 'Private', or some other
way
> to populate this field?
>
> Thanks,
> Ken
>
> [Non-text portions of this message have been removed]
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]
We have two seperate lines of order numbers we've been using and would like to continue to use. We did this originally as we had pre-printed tags labeled 1000-9999 for repair work that we used as the SO number, and we use the system generated ones for all other SO numbers. We're reaching the end of our pre-printed tags and we'll now be printing a barcode label for these, but we'd like to have them starting at 10000 and moving forward, our system generated SOs start at 80000 so we have a long time before they collide.

So, I setup a push button on the Order Entry screen and have come up with the following code:

dim ordernum as integer = 9999
dim recSelected as boolean = true
while recSelected
ordernum=ordernum+1
Dim whereClause as string = "OrderNum = '" & ordernum & "'"
Dim dsOrderNum as DataSet = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,"SalesOrderAdapter",recSelected,False,whereClause)
end while

messagebox.show(ordernum)

This works extremely well, but instead of just showing a message box with the number, I'd like it to put this into the empty SO field automatically. According to customization this field is SalesOrderForm.sheetTopLevelPanel1.summaryPanel1.txtKeyField. If I try to set this field = ordernum, I get a compiler error that the field "is not accessible in this context because it is 'Private'". Is what I'm asking for possible? Is there away around 'Private', or some other way to populate this field?

Thanks,
Ken


[Non-text portions of this message have been removed]
Try declaring the dataview (containing the field you wish to pop the custom calculated order number into) as Public withEvents instead of Private withEvents.

If that still fails, you are likely getting a (misinterpreted) error message. Most apps seem to (randomly) have at least one field that the native control just refuses to release its grip upon - so you can't directly reference it in a subroutine and update it.

To get around that, assign an appropriate custom control from the toolbox to the field and have your Sub pass the value to the new custom control (with can be hidden). That new custom control will then set the field you are trying to update (without interference from the native control).

If THAT fails, set the custom control to a free (appropriate type) user definable field in the same EpiDataView table as your target field. You should then be able to set the edvTable(field) = to your edvTable(udfield).

No idea why such machinations are sometimes required (and don't care). I just know one of the 3 methods above eventually works. I suspect the event trigger for the Sub doing the updating bears some responsibility as to which one ends up working - as well as possibly also being a contributing reason as to why the native control bound to the field sometimes 'gets in the way'.

Rob Brown

Ken Williams <ken@...> wrote:
We have two seperate lines of order numbers we've been using and would like to continue to use. We did this originally as we had pre-printed tags labeled 1000-9999 for repair work that we used as the SO number, and we use the system generated ones for all other SO numbers. We're reaching the end of our pre-printed tags and we'll now be printing a barcode label for these, but we'd like to have them starting at 10000 and moving forward, our system generated SOs start at 80000 so we have a long time before they collide.

So, I setup a push button on the Order Entry screen and have come up with the following code:

dim ordernum as integer = 9999
dim recSelected as boolean = true
while recSelected
ordernum=ordernum+1
Dim whereClause as string = "OrderNum = '" & ordernum & "'"
Dim dsOrderNum as DataSet = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,"SalesOrderAdapter",recSelected,False,whereClause)
end while

messagebox.show(ordernum)

This works extremely well, but instead of just showing a message box with the number, I'd like it to put this into the empty SO field automatically. According to customization this field is SalesOrderForm.sheetTopLevelPanel1.summaryPanel1.txtKeyField. If I try to set this field = ordernum, I get a compiler error that the field "is not accessible in this context because it is 'Private'". Is what I'm asking for possible? Is there away around 'Private', or some other way to populate this field?

Thanks,
Ken

[Non-text portions of this message have been removed]






---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.

[Non-text portions of this message have been removed]
Okay, part of the problem I'm having is I'm trying to populate a field
before any dataview has been called.

I'm in Order Entry and I'd like to populate the keyfield so when they
leave the keyfield it then creates a new SO with that number (same as if
you had typed an unused number in).

I tried to create a custom control to populate OrderHed.OrderNum, but
that just results in a nice Microsoft .NET Framework crash.

I did notice in the "all code" there is "Private WithEvents
SalesOrderForm As Epicor.Mfg.UI.App.SalesOrderEntry.SalesOrderForm" -
beings it only shows when I select All Code, means I can't edit it to
make it public.

Any other ideas?

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Robert Brown
Sent: Tuesday, January 15, 2008 3:53 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Populate 'private' fields - customization
question



Try declaring the dataview (containing the field you wish to pop the
custom calculated order number into) as Public withEvents instead of
Private withEvents.

If that still fails, you are likely getting a (misinterpreted) error
message. Most apps seem to (randomly) have at least one field that the
native control just refuses to release its grip upon - so you can't
directly reference it in a subroutine and update it.

To get around that, assign an appropriate custom control from the
toolbox to the field and have your Sub pass the value to the new custom
control (with can be hidden). That new custom control will then set the
field you are trying to update (without interference from the native
control).

If THAT fails, set the custom control to a free (appropriate type) user
definable field in the same EpiDataView table as your target field. You
should then be able to set the edvTable(field) = to your
edvTable(udfield).

No idea why such machinations are sometimes required (and don't care). I
just know one of the 3 methods above eventually works. I suspect the
event trigger for the Sub doing the updating bears some responsibility
as to which one ends up working - as well as possibly also being a
contributing reason as to why the native control bound to the field
sometimes 'gets in the way'.

Rob Brown

Ken Williams <ken@...
<mailto:ken%40intermountainelectronics.com> > wrote:
We have two seperate lines of order numbers we've been using and would
like to continue to use. We did this originally as we had pre-printed
tags labeled 1000-9999 for repair work that we used as the SO number,
and we use the system generated ones for all other SO numbers. We're
reaching the end of our pre-printed tags and we'll now be printing a
barcode label for these, but we'd like to have them starting at 10000
and moving forward, our system generated SOs start at 80000 so we have a
long time before they collide.

So, I setup a push button on the Order Entry screen and have come up
with the following code:

dim ordernum as integer = 9999
dim recSelected as boolean = true
while recSelected
ordernum=ordernum+1
Dim whereClause as string = "OrderNum = '" & ordernum & "'"
Dim dsOrderNum as DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,"SalesOrde
rAdapter",recSelected,False,whereClause)
end while

messagebox.show(ordernum)

This works extremely well, but instead of just showing a message box
with the number, I'd like it to put this into the empty SO field
automatically. According to customization this field is
SalesOrderForm.sheetTopLevelPanel1.summaryPanel1.txtKeyField. If I try
to set this field = ordernum, I get a compiler error that the field "is
not accessible in this context because it is 'Private'". Is what I'm
asking for possible? Is there away around 'Private', or some other way
to populate this field?

Thanks,
Ken

[Non-text portions of this message have been removed]

---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo!
Search.

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]
I did not know you could assign Sales Order Numbers but try this. It
will allow you to populate the field, not sure how you will be able
to get past that but if you do please let me know how.

'After the begining of the module:

Private WithEvents txtKeyField As EpiTextBox

'Then create an on load event:

txtKeyField = ctype(csm.GetNativeControlReverence(""4fceeeec-518c-
4256-932e-34a4c1a584ee"),EpiTextBox)

'Then set txtKeyField I am not sure if you have to convert your
number to a string or not.






--- In vantage@yahoogroups.com, "Ken Williams" <ken@...> wrote:
>
> Okay, part of the problem I'm having is I'm trying to populate a
field
> before any dataview has been called.
>
> I'm in Order Entry and I'd like to populate the keyfield so when
they
> leave the keyfield it then creates a new SO with that number (same
as if
> you had typed an unused number in).
>
> I tried to create a custom control to populate OrderHed.OrderNum,
but
> that just results in a nice Microsoft .NET Framework crash.
>
> I did notice in the "all code" there is "Private WithEvents
> SalesOrderForm As
Epicor.Mfg.UI.App.SalesOrderEntry.SalesOrderForm" -
> beings it only shows when I select All Code, means I can't edit it
to
> make it public.
>
> Any other ideas?
>
> ________________________________
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf
> Of Robert Brown
> Sent: Tuesday, January 15, 2008 3:53 PM
> To: vantage@yahoogroups.com
> Subject: Re: [Vantage] Populate 'private' fields - customization
> question
>
>
>
> Try declaring the dataview (containing the field you wish to pop
the
> custom calculated order number into) as Public withEvents instead
of
> Private withEvents.
>
> If that still fails, you are likely getting a (misinterpreted)
error
> message. Most apps seem to (randomly) have at least one field that
the
> native control just refuses to release its grip upon - so you can't
> directly reference it in a subroutine and update it.
>
> To get around that, assign an appropriate custom control from the
> toolbox to the field and have your Sub pass the value to the new
custom
> control (with can be hidden). That new custom control will then
set the
> field you are trying to update (without interference from the
native
> control).
>
> If THAT fails, set the custom control to a free (appropriate type)
user
> definable field in the same EpiDataView table as your target
field. You
> should then be able to set the edvTable(field) = to your
> edvTable(udfield).
>
> No idea why such machinations are sometimes required (and don't
care). I
> just know one of the 3 methods above eventually works. I suspect
the
> event trigger for the Sub doing the updating bears some
responsibility
> as to which one ends up working - as well as possibly also being a
> contributing reason as to why the native control bound to the field
> sometimes 'gets in the way'.
>
> Rob Brown
>
> Ken Williams <ken@...
> <mailto:ken%40intermountainelectronics.com> > wrote:
> We have two seperate lines of order numbers we've been using and
would
> like to continue to use. We did this originally as we had pre-
printed
> tags labeled 1000-9999 for repair work that we used as the SO
number,
> and we use the system generated ones for all other SO numbers.
We're
> reaching the end of our pre-printed tags and we'll now be printing
a
> barcode label for these, but we'd like to have them starting at
10000
> and moving forward, our system generated SOs start at 80000 so we
have a
> long time before they collide.
>
> So, I setup a push button on the Order Entry screen and have come
up
> with the following code:
>
> dim ordernum as integer = 9999
> dim recSelected as boolean = true
> while recSelected
> ordernum=ordernum+1
> Dim whereClause as string = "OrderNum = '" & ordernum & "'"
> Dim dsOrderNum as DataSet =
> Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
(oTrans,"SalesOrde
> rAdapter",recSelected,False,whereClause)
> end while
>
> messagebox.show(ordernum)
>
> This works extremely well, but instead of just showing a message
box
> with the number, I'd like it to put this into the empty SO field
> automatically. According to customization this field is
> SalesOrderForm.sheetTopLevelPanel1.summaryPanel1.txtKeyField. If I
try
> to set this field = ordernum, I get a compiler error that the
field "is
> not accessible in this context because it is 'Private'". Is what
I'm
> asking for possible? Is there away around 'Private', or some other
way
> to populate this field?
>
> Thanks,
> Ken
>
> [Non-text portions of this message have been removed]
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Ahhh. I see you need to set a starting order number in company
config then you can set the order number.
--- In vantage@yahoogroups.com, "Michael McWilliams"
<mmcwilliams22@...> wrote:
>
> I did not know you could assign Sales Order Numbers but try this.
It
> will allow you to populate the field, not sure how you will be
able
> to get past that but if you do please let me know how.
>
> 'After the begining of the module:
>
> Private WithEvents txtKeyField As EpiTextBox
>
> 'Then create an on load event:
>
> txtKeyField = ctype(csm.GetNativeControlReverence(""4fceeeec-518c-
> 4256-932e-34a4c1a584ee"),EpiTextBox)
>
> 'Then set txtKeyField I am not sure if you have to convert your
> number to a string or not.
>
>
>
>
>
>
> --- In vantage@yahoogroups.com, "Ken Williams" <ken@> wrote:
> >
> > Okay, part of the problem I'm having is I'm trying to populate a
> field
> > before any dataview has been called.
> >
> > I'm in Order Entry and I'd like to populate the keyfield so when
> they
> > leave the keyfield it then creates a new SO with that number
(same
> as if
> > you had typed an unused number in).
> >
> > I tried to create a custom control to populate
OrderHed.OrderNum,
> but
> > that just results in a nice Microsoft .NET Framework crash.
> >
> > I did notice in the "all code" there is "Private WithEvents
> > SalesOrderForm As
> Epicor.Mfg.UI.App.SalesOrderEntry.SalesOrderForm" -
> > beings it only shows when I select All Code, means I can't edit
it
> to
> > make it public.
> >
> > Any other ideas?
> >
> > ________________________________
> >
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
On
> Behalf
> > Of Robert Brown
> > Sent: Tuesday, January 15, 2008 3:53 PM
> > To: vantage@yahoogroups.com
> > Subject: Re: [Vantage] Populate 'private' fields - customization
> > question
> >
> >
> >
> > Try declaring the dataview (containing the field you wish to pop
> the
> > custom calculated order number into) as Public withEvents
instead
> of
> > Private withEvents.
> >
> > If that still fails, you are likely getting a (misinterpreted)
> error
> > message. Most apps seem to (randomly) have at least one field
that
> the
> > native control just refuses to release its grip upon - so you
can't
> > directly reference it in a subroutine and update it.
> >
> > To get around that, assign an appropriate custom control from the
> > toolbox to the field and have your Sub pass the value to the new
> custom
> > control (with can be hidden). That new custom control will then
> set the
> > field you are trying to update (without interference from the
> native
> > control).
> >
> > If THAT fails, set the custom control to a free (appropriate
type)
> user
> > definable field in the same EpiDataView table as your target
> field. You
> > should then be able to set the edvTable(field) = to your
> > edvTable(udfield).
> >
> > No idea why such machinations are sometimes required (and don't
> care). I
> > just know one of the 3 methods above eventually works. I suspect
> the
> > event trigger for the Sub doing the updating bears some
> responsibility
> > as to which one ends up working - as well as possibly also being
a
> > contributing reason as to why the native control bound to the
field
> > sometimes 'gets in the way'.
> >
> > Rob Brown
> >
> > Ken Williams <ken@
> > <mailto:ken%40intermountainelectronics.com> > wrote:
> > We have two seperate lines of order numbers we've been using and
> would
> > like to continue to use. We did this originally as we had pre-
> printed
> > tags labeled 1000-9999 for repair work that we used as the SO
> number,
> > and we use the system generated ones for all other SO numbers.
> We're
> > reaching the end of our pre-printed tags and we'll now be
printing
> a
> > barcode label for these, but we'd like to have them starting at
> 10000
> > and moving forward, our system generated SOs start at 80000 so
we
> have a
> > long time before they collide.
> >
> > So, I setup a push button on the Order Entry screen and have
come
> up
> > with the following code:
> >
> > dim ordernum as integer = 9999
> > dim recSelected as boolean = true
> > while recSelected
> > ordernum=ordernum+1
> > Dim whereClause as string = "OrderNum = '" & ordernum & "'"
> > Dim dsOrderNum as DataSet =
> > Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
> (oTrans,"SalesOrde
> > rAdapter",recSelected,False,whereClause)
> > end while
> >
> > messagebox.show(ordernum)
> >
> > This works extremely well, but instead of just showing a message
> box
> > with the number, I'd like it to put this into the empty SO field
> > automatically. According to customization this field is
> > SalesOrderForm.sheetTopLevelPanel1.summaryPanel1.txtKeyField. If
I
> try
> > to set this field = ordernum, I get a compiler error that the
> field "is
> > not accessible in this context because it is 'Private'". Is what
> I'm
> > asking for possible? Is there away around 'Private', or some
other
> way
> > to populate this field?
> >
> > Thanks,
> > Ken
> >
> > [Non-text portions of this message have been removed]
> >
> > ---------------------------------
> > Looking for last minute shopping deals? Find them fast with
Yahoo!
> > Search.
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
Cool, almost there.

I added the two lines, verifying the guid. Now I am having issues with
converting the number.

I've tried cstr among other things and can't get it to take. Regardless
of how I try to convert it I get "Error: BC30311 - line 145 (486) -
Value of type 'Integer' cannot be converted to
'Epicor.Mfg.UI.FrameWork.EpiTextBox'." If I use cstr it says type
'String'. I've tried Chr as well, but I'm sure I need some fancy
ctype(csm.blahblah) that I don't know about. I think this is the last
step, thanks for your help!

(BTW, the reason for this button is we need two seperate order number
strings, refer to the initial e-mail if you're curious for more
details.)

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Michael McWilliams
Sent: Wednesday, January 16, 2008 8:52 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Populate 'private' fields - customization
question



I did not know you could assign Sales Order Numbers but try this. It
will allow you to populate the field, not sure how you will be able
to get past that but if you do please let me know how.

'After the begining of the module:

Private WithEvents txtKeyField As EpiTextBox

'Then create an on load event:

txtKeyField = ctype(csm.GetNativeControlReverence(""4fceeeec-518c-
4256-932e-34a4c1a584ee"),EpiTextBox)

'Then set txtKeyField I am not sure if you have to convert your
number to a string or not.

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Ken
Williams" <ken@...> wrote:
>
> Okay, part of the problem I'm having is I'm trying to populate a
field
> before any dataview has been called.
>
> I'm in Order Entry and I'd like to populate the keyfield so when
they
> leave the keyfield it then creates a new SO with that number (same
as if
> you had typed an unused number in).
>
> I tried to create a custom control to populate OrderHed.OrderNum,
but
> that just results in a nice Microsoft .NET Framework crash.
>
> I did notice in the "all code" there is "Private WithEvents
> SalesOrderForm As
Epicor.Mfg.UI.App.SalesOrderEntry.SalesOrderForm" -
> beings it only shows when I select All Code, means I can't edit it
to
> make it public.
>
> Any other ideas?
>
> ________________________________
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
> Of Robert Brown
> Sent: Tuesday, January 15, 2008 3:53 PM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> Subject: Re: [Vantage] Populate 'private' fields - customization
> question
>
>
>
> Try declaring the dataview (containing the field you wish to pop
the
> custom calculated order number into) as Public withEvents instead
of
> Private withEvents.
>
> If that still fails, you are likely getting a (misinterpreted)
error
> message. Most apps seem to (randomly) have at least one field that
the
> native control just refuses to release its grip upon - so you can't
> directly reference it in a subroutine and update it.
>
> To get around that, assign an appropriate custom control from the
> toolbox to the field and have your Sub pass the value to the new
custom
> control (with can be hidden). That new custom control will then
set the
> field you are trying to update (without interference from the
native
> control).
>
> If THAT fails, set the custom control to a free (appropriate type)
user
> definable field in the same EpiDataView table as your target
field. You
> should then be able to set the edvTable(field) = to your
> edvTable(udfield).
>
> No idea why such machinations are sometimes required (and don't
care). I
> just know one of the 3 methods above eventually works. I suspect
the
> event trigger for the Sub doing the updating bears some
responsibility
> as to which one ends up working - as well as possibly also being a
> contributing reason as to why the native control bound to the field
> sometimes 'gets in the way'.
>
> Rob Brown
>
> Ken Williams <ken@...
> <mailto:ken%40intermountainelectronics.com> > wrote:
> We have two seperate lines of order numbers we've been using and
would
> like to continue to use. We did this originally as we had pre-
printed
> tags labeled 1000-9999 for repair work that we used as the SO
number,
> and we use the system generated ones for all other SO numbers.
We're
> reaching the end of our pre-printed tags and we'll now be printing
a
> barcode label for these, but we'd like to have them starting at
10000
> and moving forward, our system generated SOs start at 80000 so we
have a
> long time before they collide.
>
> So, I setup a push button on the Order Entry screen and have come
up
> with the following code:
>
> dim ordernum as integer = 9999
> dim recSelected as boolean = true
> while recSelected
> ordernum=ordernum+1
> Dim whereClause as string = "OrderNum = '" & ordernum & "'"
> Dim dsOrderNum as DataSet =
> Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
(oTrans,"SalesOrde
> rAdapter",recSelected,False,whereClause)
> end while
>
> messagebox.show(ordernum)
>
> This works extremely well, but instead of just showing a message
box
> with the number, I'd like it to put this into the empty SO field
> automatically. According to customization this field is
> SalesOrderForm.sheetTopLevelPanel1.summaryPanel1.txtKeyField. If I
try
> to set this field = ordernum, I get a compiler error that the
field "is
> not accessible in this context because it is 'Private'". Is what
I'm
> asking for possible? Is there away around 'Private', or some other
way
> to populate this field?
>
> Thanks,
> Ken
>
> [Non-text portions of this message have been removed]
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>






[Non-text portions of this message have been removed]
Try this:
Dim strOrderNum As String = ordernum.ToString
txtKeyField.Text = strOrderNum

--- In vantage@yahoogroups.com, "Ken Williams" <ken@...> wrote:
>
> Cool, almost there.
>
> I added the two lines, verifying the guid. Now I am having issues
with
> converting the number.
>
> I've tried cstr among other things and can't get it to take.
Regardless
> of how I try to convert it I get "Error: BC30311 - line 145 (486) -
> Value of type 'Integer' cannot be converted to
> 'Epicor.Mfg.UI.FrameWork.EpiTextBox'." If I use cstr it says type
> 'String'. I've tried Chr as well, but I'm sure I need some fancy
> ctype(csm.blahblah) that I don't know about. I think this is the
last
> step, thanks for your help!
>
> (BTW, the reason for this button is we need two seperate order
number
> strings, refer to the initial e-mail if you're curious for more
> details.)
>
> ________________________________
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf
> Of Michael McWilliams
> Sent: Wednesday, January 16, 2008 8:52 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Populate 'private' fields - customization
> question
>
>
>
> I did not know you could assign Sales Order Numbers but try this.
It
> will allow you to populate the field, not sure how you will be
able
> to get past that but if you do please let me know how.
>
> 'After the begining of the module:
>
> Private WithEvents txtKeyField As EpiTextBox
>
> 'Then create an on load event:
>
> txtKeyField = ctype(csm.GetNativeControlReverence(""4fceeeec-518c-
> 4256-932e-34a4c1a584ee"),EpiTextBox)
>
> 'Then set txtKeyField I am not sure if you have to convert your
> number to a string or not.
>
> --- In vantage@yahoogroups.com <mailto:vantage%
40yahoogroups.com> , "Ken
> Williams" <ken@> wrote:
> >
> > Okay, part of the problem I'm having is I'm trying to populate a
> field
> > before any dataview has been called.
> >
> > I'm in Order Entry and I'd like to populate the keyfield so when
> they
> > leave the keyfield it then creates a new SO with that number
(same
> as if
> > you had typed an unused number in).
> >
> > I tried to create a custom control to populate
OrderHed.OrderNum,
> but
> > that just results in a nice Microsoft .NET Framework crash.
> >
> > I did notice in the "all code" there is "Private WithEvents
> > SalesOrderForm As
> Epicor.Mfg.UI.App.SalesOrderEntry.SalesOrderForm" -
> > beings it only shows when I select All Code, means I can't edit
it
> to
> > make it public.
> >
> > Any other ideas?
> >
> > ________________________________
> >
> > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com <mailto:vantage%
40yahoogroups.com> ] On
> Behalf
> > Of Robert Brown
> > Sent: Tuesday, January 15, 2008 3:53 PM
> > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > Subject: Re: [Vantage] Populate 'private' fields - customization
> > question
> >
> >
> >
> > Try declaring the dataview (containing the field you wish to pop
> the
> > custom calculated order number into) as Public withEvents
instead
> of
> > Private withEvents.
> >
> > If that still fails, you are likely getting a (misinterpreted)
> error
> > message. Most apps seem to (randomly) have at least one field
that
> the
> > native control just refuses to release its grip upon - so you
can't
> > directly reference it in a subroutine and update it.
> >
> > To get around that, assign an appropriate custom control from the
> > toolbox to the field and have your Sub pass the value to the new
> custom
> > control (with can be hidden). That new custom control will then
> set the
> > field you are trying to update (without interference from the
> native
> > control).
> >
> > If THAT fails, set the custom control to a free (appropriate
type)
> user
> > definable field in the same EpiDataView table as your target
> field. You
> > should then be able to set the edvTable(field) = to your
> > edvTable(udfield).
> >
> > No idea why such machinations are sometimes required (and don't
> care). I
> > just know one of the 3 methods above eventually works. I suspect
> the
> > event trigger for the Sub doing the updating bears some
> responsibility
> > as to which one ends up working - as well as possibly also being
a
> > contributing reason as to why the native control bound to the
field
> > sometimes 'gets in the way'.
> >
> > Rob Brown
> >
> > Ken Williams <ken@
> > <mailto:ken%40intermountainelectronics.com> > wrote:
> > We have two seperate lines of order numbers we've been using and
> would
> > like to continue to use. We did this originally as we had pre-
> printed
> > tags labeled 1000-9999 for repair work that we used as the SO
> number,
> > and we use the system generated ones for all other SO numbers.
> We're
> > reaching the end of our pre-printed tags and we'll now be
printing
> a
> > barcode label for these, but we'd like to have them starting at
> 10000
> > and moving forward, our system generated SOs start at 80000 so
we
> have a
> > long time before they collide.
> >
> > So, I setup a push button on the Order Entry screen and have
come
> up
> > with the following code:
> >
> > dim ordernum as integer = 9999
> > dim recSelected as boolean = true
> > while recSelected
> > ordernum=ordernum+1
> > Dim whereClause as string = "OrderNum = '" & ordernum & "'"
> > Dim dsOrderNum as DataSet =
> > Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
> (oTrans,"SalesOrde
> > rAdapter",recSelected,False,whereClause)
> > end while
> >
> > messagebox.show(ordernum)
> >
> > This works extremely well, but instead of just showing a message
> box
> > with the number, I'd like it to put this into the empty SO field
> > automatically. According to customization this field is
> > SalesOrderForm.sheetTopLevelPanel1.summaryPanel1.txtKeyField. If
I
> try
> > to set this field = ordernum, I get a compiler error that the
> field "is
> > not accessible in this context because it is 'Private'". Is what
> I'm
> > asking for possible? Is there away around 'Private', or some
other
> way
> > to populate this field?
> >
> > Thanks,
> > Ken
> >
> > [Non-text portions of this message have been removed]
> >
> > ---------------------------------
> > Looking for last minute shopping deals? Find them fast with
Yahoo!
> > Search.
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Just for my information, are you trying to assign the Order number when
the order header is started or when the header is completed? Under
normal circumstances you would get the order number when the header is
saved. I would think you would be able to override the business process
at that point to save the order number the way you want to.



Charlie Smith

2W Technologies LLC / Smith Business Services





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ken Williams
Sent: Wednesday, January 16, 2008 11:29 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: Populate 'private' fields - customization
question



Cool, almost there.

I added the two lines, verifying the guid. Now I am having issues with
converting the number.

I've tried cstr among other things and can't get it to take. Regardless
of how I try to convert it I get "Error: BC30311 - line 145 (486) -
Value of type 'Integer' cannot be converted to
'Epicor.Mfg.UI.FrameWork.EpiTextBox'." If I use cstr it says type
'String'. I've tried Chr as well, but I'm sure I need some fancy
ctype(csm.blahblah) that I don't know about. I think this is the last
step, thanks for your help!

(BTW, the reason for this button is we need two seperate order number
strings, refer to the initial e-mail if you're curious for more
details.)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Michael McWilliams
Sent: Wednesday, January 16, 2008 8:52 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Re: Populate 'private' fields - customization
question

I did not know you could assign Sales Order Numbers but try this. It
will allow you to populate the field, not sure how you will be able
to get past that but if you do please let me know how.

'After the begining of the module:

Private WithEvents txtKeyField As EpiTextBox

'Then create an on load event:

txtKeyField = ctype(csm.GetNativeControlReverence(""4fceeeec-518c-
4256-932e-34a4c1a584ee"),EpiTextBox)

'Then set txtKeyField I am not sure if you have to convert your
number to a string or not.

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> , "Ken
Williams" <ken@...> wrote:
>
> Okay, part of the problem I'm having is I'm trying to populate a
field
> before any dataview has been called.
>
> I'm in Order Entry and I'd like to populate the keyfield so when
they
> leave the keyfield it then creates a new SO with that number (same
as if
> you had typed an unused number in).
>
> I tried to create a custom control to populate OrderHed.OrderNum,
but
> that just results in a nice Microsoft .NET Framework crash.
>
> I did notice in the "all code" there is "Private WithEvents
> SalesOrderForm As
Epicor.Mfg.UI.App.SalesOrderEntry.SalesOrderForm" -
> beings it only shows when I select All Code, means I can't edit it
to
> make it public.
>
> Any other ideas?
>
> ________________________________
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
> Of Robert Brown
> Sent: Tuesday, January 15, 2008 3:53 PM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> Subject: Re: [Vantage] Populate 'private' fields - customization
> question
>
>
>
> Try declaring the dataview (containing the field you wish to pop
the
> custom calculated order number into) as Public withEvents instead
of
> Private withEvents.
>
> If that still fails, you are likely getting a (misinterpreted)
error
> message. Most apps seem to (randomly) have at least one field that
the
> native control just refuses to release its grip upon - so you can't
> directly reference it in a subroutine and update it.
>
> To get around that, assign an appropriate custom control from the
> toolbox to the field and have your Sub pass the value to the new
custom
> control (with can be hidden). That new custom control will then
set the
> field you are trying to update (without interference from the
native
> control).
>
> If THAT fails, set the custom control to a free (appropriate type)
user
> definable field in the same EpiDataView table as your target
field. You
> should then be able to set the edvTable(field) = to your
> edvTable(udfield).
>
> No idea why such machinations are sometimes required (and don't
care). I
> just know one of the 3 methods above eventually works. I suspect
the
> event trigger for the Sub doing the updating bears some
responsibility
> as to which one ends up working - as well as possibly also being a
> contributing reason as to why the native control bound to the field
> sometimes 'gets in the way'.
>
> Rob Brown
>
> Ken Williams <ken@...
> <mailto:ken%40intermountainelectronics.com> > wrote:
> We have two seperate lines of order numbers we've been using and
would
> like to continue to use. We did this originally as we had pre-
printed
> tags labeled 1000-9999 for repair work that we used as the SO
number,
> and we use the system generated ones for all other SO numbers.
We're
> reaching the end of our pre-printed tags and we'll now be printing
a
> barcode label for these, but we'd like to have them starting at
10000
> and moving forward, our system generated SOs start at 80000 so we
have a
> long time before they collide.
>
> So, I setup a push button on the Order Entry screen and have come
up
> with the following code:
>
> dim ordernum as integer = 9999
> dim recSelected as boolean = true
> while recSelected
> ordernum=ordernum+1
> Dim whereClause as string = "OrderNum = '" & ordernum & "'"
> Dim dsOrderNum as DataSet =
> Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
(oTrans,"SalesOrde
> rAdapter",recSelected,False,whereClause)
> end while
>
> messagebox.show(ordernum)
>
> This works extremely well, but instead of just showing a message
box
> with the number, I'd like it to put this into the empty SO field
> automatically. According to customization this field is
> SalesOrderForm.sheetTopLevelPanel1.summaryPanel1.txtKeyField. If I
try
> to set this field = ordernum, I get a compiler error that the
field "is
> not accessible in this context because it is 'Private'". Is what
I'm
> asking for possible? Is there away around 'Private', or some other
way
> to populate this field?
>
> Thanks,
> Ken
>
> [Non-text portions of this message have been removed]
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]