web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

losing value of control, when moving to another field

(0) ShareShare
ReportReport
Posted on by 1,987
Hi,
 
I have an unbound control on a dialog, that in some cases i might set it's value based on modification of another control called control1.
The purpose of this unbound control is,  when i close the dialog, I will pass it's value to class1 to do things.

But if i go to another field in the dialog i lose the value of the unbound control.
I handled it by creating "parm" method and setting it again in "close ok" method, but is there another way?

[ExtensionOf(FormControlStr(From1, control1))]
final class Form1Control1_Extension
{
    public boolean modified()
    {
        boolean ret = next modified();

        if (ret)
        {
           
            if (certain logic)
            {
                element.setUnboundControl()
            }
        }

        return ret;
    }
}
[ExtensionOf(formStr(Form1))]
final class Form1_Extension
{
    private NoYesId unboundControlValue;
	
    public void setUnboundControl()
    {
        //logic
        FormCheckBoxControl unboundControl = formDesign.controlName(formControlStr(From1, UnboundControl)) as FormCheckBoxControl;
        if (unboundControl && xControl && yControl)
        {
            suppressChargesControl.value(xControl.value() || yControl.value());  //assume xControl and yControl are defined
            this.parmUnboundControlValue(unboundControl.value());
        }
    }
	
    public NoYesId parmUnboundControlValue(NoYesId _annsSuppressChargesValue = unboundControlValue)
    {
        unboundControlValue = _unboundControlValue;
    
        return unboundControlValue;
    }
	
    public boolean closedOk()
    {
        boolean ret;  
       
        ret = next closedOk();

        if (unboundControlValue &&
            unboundControlValue != UnboundControl.value())
        {
            UnboundControl.value(unboundControlValue);
        }

        class1.parmUnboundControl(UnboundControl.value());
	}

}
 
Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans