A better place to put your code is in the validate() field.

You can return either true or false from validate() depending on the
user's selection in the box, and this will tell Axapta whether or not
to make the modification.  It's easier, plus it's "the Axapta way."

Also, if your grid date control is bound to a table field, then you're
better to use the validate() - or modified() if you do it that way -
on the field on the datasource, rather than directly on the grid
control.  This way, if another control is put on the form for the same
field, your validation code will still be run.

Hope that helps

Andrew Jones

--- In development-axapta@yahoogroups.com, Padmaja Iyingar
<[EMAIL PROTECTED]> wrote:
>
> Hi,
> I am not able to get it working. I hope someone will help me.

> I have a grid and one of fields is "dateEdit". I have a modified
method on the dateEdit field. Say, if the user tries to modify the
date, I am prompting a messageBox with Yes or No button.

> What I would like to have is, if user select 'No' option, the value
should not be modified to new value , it should retain the old value.
I know its something to do with placing super() call.
> But I could not make it working.

> Pls find a piece of my code.

>
/****************************************************************************/

> public boolean modified()
> {
>       boolean ret;
>        ret = super();
>    
>    if( Box::yesNo(sometext,DialogButton::Yes) == DialogButton::Yes)
>      {
>   change the date;
>      }
>     else {
>               don't change the date.
>            }
>     
>
>     return ret;
> }


> but if I select yes or no also, the date is getting modified. How
can I prevent modifying the date if the user selects 'No'.

> Can any one help me?. or do we need to write a validatewrite method
......

> Thanks in advance

> -Padmaja
>





>
/***********************************************************************/


>
>            
> ---------------------------------
> Do you Yahoo!?
>  The all-new My Yahoo! – What will yours do?
>
> [Non-text portions of this message have been removed]








Yahoo! Groups Links

Reply via email to