Maximum length for existing EpiTextBox fields

Thank you Michael,
it works like a charm.

Of course my GID was different. :P

Grzegorz Szczepański

Dnia Tue, 20 May 2008 16:28:12 -0000
"Michael McWilliams" <mmcwilliams22@...> napisał(a):

> Put the following under Module script:
>
> Private WithEvents txtKeyField As EpiTextBox
>
>
> Then on the form load event put the following.
>
> txtKeyField = Ctype(csm.GetNativeControlReference("3a3fffc1-6dee-
> 4be0-b52e-7fc5f80e7b95"),EpiTextBox)
> txtKeyField.MaxLength = 5
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> The numbers in parenthesis would be equal to the EpiBinding, and
> the txtKeyField(That is what it is in Customer Entry) is equal to
> the Native Epicor Control you want to use. Some time back someone
> gave me this info and it has helped out many times.
Hello,
I have a little problem with customisation. When I am adding a TextBox
filed then I can restrict it to specific length using MaxLength member
of TextBox (or EpiTextBox) Class.

I can't do this for already existing fields. For example trying to do
with name for customer (control name is: txtName, type EpiTextBox,
binding Customer.Name).
When trying to use txtName in Script editor it complain that variable
wasn't defined. Can someone help me with that?

Please don't send me to ObjectExplorer as definitions from that place
are rather to values behind the fields rarther than to controls
(fields) itself. Of course if I am wrong please correct me.

Grzegorz Szczepanski
Put the following under Module script:

Private WithEvents txtKeyField As EpiTextBox


Then on the form load event put the following.

txtKeyField = Ctype(csm.GetNativeControlReference("3a3fffc1-6dee-
4be0-b52e-7fc5f80e7b95"),EpiTextBox)
txtKeyField.MaxLength = 5

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The numbers in parenthesis would be equal to the EpiBinding, and
the txtKeyField(That is what it is in Customer Entry) is equal to
the Native Epicor Control you want to use. Some time back someone
gave me this info and it has helped out many times.




--- In vantage@yahoogroups.com, "tomojmail" <phoenix_@...> wrote:
>
> Hello,
> I have a little problem with customisation. When I am adding a
TextBox
> filed then I can restrict it to specific length using MaxLength
member
> of TextBox (or EpiTextBox) Class.
>
> I can't do this for already existing fields. For example trying to
do
> with name for customer (control name is: txtName, type EpiTextBox,
> binding Customer.Name).
> When trying to use txtName in Script editor it complain that
variable
> wasn't defined. Can someone help me with that?
>
> Please don't send me to ObjectExplorer as definitions from that
place
> are rather to values behind the fields rarther than to controls
> (fields) itself. Of course if I am wrong please correct me.
>
> Grzegorz Szczepanski
>
Do I understand that you want to limit the size of the box as it appears on the screen? And it's not buying a statement involving txtName.MaximumSize? I just looked in Custom Object Explorer and got this:

'// ** Get Property
Dim [varName] As Size = Control.MaximumSize
'// ** Set Property
Control.MaximumSize = [varName] or value

It has 3 more properties under that - Height, IsEmpty, and Width.

It should recognize the control name, since that already exists on the form. If it's not doing that, something is indeed weird. In the form I looked at, the existing text box had a prefix of 'tb' and not 'txt'. Could that be part of your problem? It's certainly something _I_ could do easily enough.

Lynn Thomas
Senior Engineer
SAIC
317-357-4041 X255



[Non-text portions of this message have been removed]
Please take a look at the below code example from Michael.
I think that this is what I was looking for.
My mistake was that I was trying txtKeyField =
Ctype(csm.GetNativeControlReference("txtName_3a3fffc1_6dee_
4be0_b52e_7fc5f80e7b95"),EpiTextBox) instead of what was his proposal.
I didn't check it yet. I will let you know how it works when I will
check it.

I wasn't looking for limiting the size of box, I was looking for
limiting the quantity of characters that you can put into this box.


Michael proposal:
Put the following under Module script:
Private WithEvents txtKeyField As EpiTextBox
Then on the form load event put the following.
txtKeyField = Ctype(csm.GetNativeControlReference("3a3fffc1-6dee-
4be0-b52e-7fc5f80e7b95"),EpiTextBox)
txtKeyField.MaxLength = 5


Grzegorz Szczepański


Dnia Tue, 20 May 2008 13:06:03 -0400
"Thomas, Lynn A." <thomasl@...> napisał(a):

> Do I understand that you want to limit the size of the box as it
> appears on the screen? And it's not buying a statement involving
> txtName.MaximumSize? I just looked in Custom Object Explorer and got
> this:
>
> '// ** Get Property
> Dim [varName] As Size = Control.MaximumSize
> '// ** Set Property
> Control.MaximumSize = [varName] or value
>
> It has 3 more properties under that - Height, IsEmpty, and Width.
>
> It should recognize the control name, since that already exists on
> the form. If it's not doing that, something is indeed weird. In the
> form I looked at, the existing text box had a prefix of 'tb' and not
> 'txt'. Could that be part of your problem? It's certainly something
> _I_ could do easily enough.
>
> Lynn Thomas
> Senior Engineer
> SAIC
> 317-357-4041 X255
>
>
>
> [Non-text portions of this message have been removed]
>