Hi Gideon,


There are many ways to obtain it, though none of them
is an easy task (as I know).

The first way is, you create an array EDT (EDT with
more than one array elements). The drawback is, the UI
will create multiple stringEdit.

The second way is, to manipulating the input controls
just like real edit (format will be cleared when the
cursor is entered and display the format after the
cursor leaves).

The sample code is like this:
Set MyTable_1_Field1Ctl "AutoDeclaration" of
StringEdit control to "Yes".
Override three methods: enter, leave and validate of
that control.

public class FormRun extends ObjectRun
{
    boolean validateCalled;
}
public void enter()
{
    str a;
    ;
    super();                                 
    //format: uk-12-3
    validateCalled  = false;
    a   = MyTable_1.Field1;
    MyTable_1.Field1 = substr(a,4,2) + substr(a,7,1);
    MyTable_1_ds.refresh();
}
public boolean validate()
{
    boolean ret;
    str a;
    ret = super();
    a   = MyTable_1_Field1Ctl.text();

    MyTable_1.Field1 = 'UK-' + substr(a,1,2) + '-' +
substr(a,3,1);

    validateCalled  = true;
    MyTable_1_ds.refresh();
    return ret;
}
public boolean leave()
{
    boolean ret;

    ret = super();

    if (!validateCalled)
        this.validate();

    return ret;
}

The third way is, to use AxtiveX to obtain it. For
this solution I don't know the activeX name yet that
can be used together with the Axapta. So, actually
this is just an idea.


Maybe other people in this forum have a better idea
for the solution.

Good luck.

Regards,

Sonny Wibawa Adi, MBSCP, MCAD.NET, MCSD.NET, MCP

--- gideonneijs <[EMAIL PROTECTED]> wrote:

> Hi Tom,
>
> Thanks for the reply.
> The problem is that i don't want to use a number
> sequence. I only
> want to make sure the format of the number is
> correct. The number
> itself can be any number.
>
> Best regards,
>
> Gideon
>
> --- In development-axapta@yahoogroups.com,
> "taulbert2000" <[EMAIL PROTECTED]>
> wrote:
> > Hi Gideon,
> > why don't you use the format of the number
> sequence?
> > Your example should look like this: UK-##-####-##.
> >
> > Best regards,
> > Tom
> >
> > --- In development-axapta@yahoogroups.com, Gideon
> Neijs
> > <[EMAIL PROTECTED]> wrote:
> > > Hi all,
> > >
> > > 
> > >
> > > Does anyone know if it's possible to set up an
> input mask on an
> EDT or a table field?
> > >
> > > For example: I want to prescribe that an item id
> always has the
> > following
> > > fomat:    xx-xx-xxxx-xx  (e.g  UK-34-8732-02)
> > >
> > > 
> > >
> > > Does anyone know if this is possible or have an
> suggestion?
> > >
> > > 
> > >
> > > Thanks in advance!
> > >
> > > 
> > >
> > > Gideon
>
>
>
>
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com




YAHOO! GROUPS LINKS




Reply via email to