dialog field

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Verified) This post has 2 verified solutions | 16 Replies | 6 Followers

Male
14 Posts
165 Points
Joined: 2010-12-14
Last Online:
2013-5-7 14:34
Location: Noida, India
Nitish Kumar posted on 2012-4-18 10:51

Hi All,

Is it possible to modify dialog field while I am changing the other dialog field value accordingly.

I have created a dialog by class. It contain two fields custId & custName. what I want  is, when I change the custId Field value on dialog, then accordingly the custName field should modified.

Plz help.

Thanks

Nitish Kr Gupta

 

Solution (Verified) Verified Solution

Male
33 Posts
375 Points
Joined: 2010-10-29
Last Online:
2012-7-5 12:10
Location: Hyd and india
Solution (Verified) Krishna replied on 2012-4-19 9:27
Verified by Nitish Kumar

The modified method can also be accessed by overriding

public void dialogSelectCtrl()
{
}

in the runbase class. Just call

dialog.allowUpdateOnSelectCtrl(true);

in the dialog method.

You can also create a dialog form and pass it as the parameter in the dialog method of runbase class. you can find an example in tutorial_runbase class and form.

Male
12 Posts
320 Points
Joined: 2010-12-14
Last Online:
2013-3-19 17:02
Location: Chennai,India
Solution (Verified) Imran replied on 2012-4-19 9:33
Verified by Nitish Kumar

Hi Nitish,

In order to achieve dynamic dialog event overloading your dialog class need to extend Runbase class.

In your dialog method add this following code

dialog.allowUpdateOnSelectCtrl(true);

Create a new method 

public void dialogSelectCtrl()

{

    ;

    fieldName.value(custTable::find(fieldAccount.value()).Name);

}

No need of Fld1_1_modified() method.

dialogSelectCtrl is a method in Runbase class.

Hope this solves your problem. 

All Replies

Male
175 Posts
1,855 Points
Joined: 2012-2-2
Last Online:
2013-5-24 15:27
Location: Ahmedabad , Gujarat
Lalit replied on 2012-4-18 11:30

HI Nitish,

To provide a better solution for this , you create a look up in your custId field and override the modified method of the look up

after which according to me your problem may get resolved.

With Regards :
LMJ

Male
14 Posts
165 Points
Joined: 2010-12-14
Last Online:
2013-5-7 14:34
Location: Noida, India
Nitish Kumar replied on 2012-4-18 11:36

Hi Lalit,

can u please explain in detail plesse.

Thanks

Nitish

Male
12 Posts
320 Points
Joined: 2010-12-14
Last Online:
2013-3-19 17:02
Location: Chennai,India
Imran replied on 2012-4-18 13:11

Hi Nitish,

Its possible. First you should know the name of the custId dialog field. You can do so by adding the following code to the bottom of your dialog method.

info (custId.name());//custId is the dialog field

Once you know the dialog field name, you can override its modified method by adding the following method to your class.

void dialogFieldName_modified()//specify the name you get from the info method in place of "dialogFieldName"

{

<specify your logic here>

}

Hope this helps you

Male
14 Posts
165 Points
Joined: 2010-12-14
Last Online:
2013-5-7 14:34
Location: Noida, India
Nitish Kumar replied on 2012-4-18 14:21

Hi Imran,

Thanks for replying.

Can u please explain how to specify logic here. I am not getting it.

I got the custId Field Name by Info its comming like  "Fld1_1 ".

Eagerly waiting for ur reply.

Thanks

Nitish

Male
12 Posts
320 Points
Joined: 2010-12-14
Last Online:
2013-3-19 17:02
Location: Chennai,India
Imran replied on 2012-4-18 14:42

By logic I mean, get the customer name for the selected customer Id and assign it to customer name dialog field here ...

your method should look like

void Fld1_1_modified()

{

    CustName.value(custTable::find(CustId.value())).Name;

}

 

Male
14 Posts
165 Points
Joined: 2010-12-14
Last Online:
2013-5-7 14:34
Location: Noida, India
Nitish Kumar replied on 2012-4-19 6:58

Hi Imran,

I did as u suggested, but custName is not showing in dialog field. I also applied debugger on 'fld1_1_modifid' method but debugger is not going there.

Here is code I written on modified method.

void Fld1_1_modified()

{;

    fieldName.value(custTable::find(fieldAccount.value()).Name);

}

here   fieldName & fieldAccount are dialog field name for custName & custAccount respectively.

please suggest what next to do .

Thanks

Nitish   

55 Posts
740 Points
Joined: 2011-11-15
Last Online:
2013-5-20 15:20
Location: Chennai
AshNan replied on 2012-4-19 8:20

Hi,

try this...

 

Public boolean fld1_1_modified()
{
    FormStringControl   control;
    boolean             isFieldModified;
    ;
    control= dialog.formRun().controlCallingMethod();

    isFieldModified = control.modified();

    if(isFieldModified)
    {

        dialogName.value(custTable::find(fieldAccount.value()).Name);
       
    }
    return isFieldModified;
}

Male
33 Posts
375 Points
Joined: 2010-10-29
Last Online:
2012-7-5 12:10
Location: Hyd and india
Solution (Verified) Krishna replied on 2012-4-19 9:27
Verified by Nitish Kumar

The modified method can also be accessed by overriding

public void dialogSelectCtrl()
{
}

in the runbase class. Just call

dialog.allowUpdateOnSelectCtrl(true);

in the dialog method.

You can also create a dialog form and pass it as the parameter in the dialog method of runbase class. you can find an example in tutorial_runbase class and form.

Male
12 Posts
320 Points
Joined: 2010-12-14
Last Online:
2013-3-19 17:02
Location: Chennai,India
Solution (Verified) Imran replied on 2012-4-19 9:33
Verified by Nitish Kumar

Hi Nitish,

In order to achieve dynamic dialog event overloading your dialog class need to extend Runbase class.

In your dialog method add this following code

dialog.allowUpdateOnSelectCtrl(true);

Create a new method 

public void dialogSelectCtrl()

{

    ;

    fieldName.value(custTable::find(fieldAccount.value()).Name);

}

No need of Fld1_1_modified() method.

dialogSelectCtrl is a method in Runbase class.

Hope this solves your problem. 

Male
14 Posts
165 Points
Joined: 2010-12-14
Last Online:
2013-5-7 14:34
Location: Noida, India
Nitish Kumar replied on 2012-4-19 11:19

Thanks Imran 

 

Its working.

but name in custName is changing after clicking on other control, not immediately after selecting the custId. if u have any idea about it, otherwise it ok.

 

Many Thanks

Nitish

1 Posts
10 Points
Joined: 2012-5-21
Last Online:
2012-5-22 13:40
Location: France
yhù replied on 2012-5-21 11:25

Hello !

i have the same problem, the value change after clicking on other control :s

do you have a solution ?

thanks a lot

271 Posts
3,525 Points
Joined: 2011-7-29
Last Online:
2013-5-17 8:05
Location: Banglore, India
EnriqueKevin06 replied on 2012-5-21 11:45

hi,

 

   Just view above in this page and you will gea soln..

2 Posts
10 Points
Joined: 2006-11-2
Last Online:
2012-11-12 12:39
rajdil replied on 2012-10-25 13:12

Hi Don't forget to added this method in your class to make the fld1_1_Modified to work properly

public void dialogPostRun(DialogRunbase _dialog)

{

    super(_dialog);

 

    _dialog.dialogForm().formRun().controlMethodOverload(true);

    _dialog.dialogForm().formRun().controlMethodOverloadObject(this);

}

2 Posts
10 Points
Joined: 2006-11-2
Last Online:
2012-11-12 12:39
rajdil replied on 2012-10-25 13:25

Using This method  is a problem if you want to modify the dialog field name after that it would allow you to change but it would still take the default code written for the account num change. 

 

In scenario where you want to change the Name after it returns it is not possible to use this method  

Page 1 of 2 (17 items) 1 2 Next > | Get this RSS feed | Bookmark and Share