Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Set dialog value based on other dialog UI Builder x++

(1) ShareShare
ReportReport
Posted on by
I have created a dialog using lookup button table name (Calendar ), and two from date and to date contracts , as soon as i select the value in calendar lookup table , from date and to date values should be updated from as per field selected in calendar table i.e month start date in fromdate and month end date in todate
/// <summary>
/// ClaimManagementUIBuilder - UI Builder Class
/// </summary>
[DataContractAttribute,SysOperationContractProcessingAttribute(classStr(ClaimManagementContract),
SysOperationDataContractProcessingMode::CreateUIBuilderForRootContractOnly)]
class ClaimManagementUIBuilder extends SysOperationAutomaticUIBuilder
{
    DialogField     dialogPeriod,dialogFromDate,dialogToDate;

    
    /// <summary>
    /// lookup of customer account
    /// </summary>
    /// <param name = "_control">FormStringControl</param>
    public void lookupCokePeriod(FormStringControl _control)
    {
        SysTableLookup                      sysTableLookup;
       
        sysTableLookup = SysTableLookup::newParameters(tableNum(OEI1CokeCalendar), _control);
           
        sysTableLookup.addLookupfield(fieldNum(Calendar, Quarter));
        sysTableLookup.addLookupfield(fieldNum(Calendar, MonthStartDate));
        sysTableLookup.addLookupfield(fieldNum(Calendar, MonthEndDate));
        sysTableLookup.performFormLookup();
    }

    public void postBuild()
    {
        super();

        dialogPeriod        = this.bindInfo().getDialogField(this.dataContractObject(),
                          methodStr(OEI1_ClaimManagementContract, parmPeriodMonthly));

        dialogPeriod.registerOverrideMethod(methodStr(FormStringControl,lookup),
                        methodStr(OEI1_ClaimManagementUIBuilder, lookupCokePeriod),this);

        dialogPeriod.control().mandatory(true);

        dialogFromDate      = this.bindInfo().getDialogField(this.dataContractObject(),
                          methodStr(OEI1_ClaimManagementContract, parmFromDate));

        dialogFromDate.allowEdit(false);

        dialogToDate        = this.bindInfo().getDialogField(this.dataContractObject(),
                          methodStr(OEI1_ClaimManagementContract, parmToDate));

        dialogToDate.allowEdit(false);
                    


    }

}
 
  • Waed Ayyad Profile Picture
    8,318 Super User 2025 Season 1 on at
    Set dialog value based on other dialog UI Builder x++
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad
  • Layan Jwei Profile Picture
    7,788 Super User 2025 Season 1 on at
    Set dialog value based on other dialog UI Builder x++
    Hi,
     
    There was a similar question before. It was about ssrs uiBuilder but it's still the same.
    So you need to registerOverride the modified method of the calendar field in the postRun method..and inside the method you can set the values.
     
    So maybe sth like that:
     
    public void postRun()
    {
        super();
     
        // Override modified method
        dialogPeriod.registerOverrideMethod(methodStr(FormStringControl, modified),methodStr(OEI1_ClaimManagementUIBuilder, cokePeriod_modified),this);
    }
     
    private boolean cokePeriod_modified(FormStringControl _control)
    {
        this.modifyDialogFields();
     
        return _control.modified();
    }
     
    private void modifyDialogFields()
    {
        dialogFromDate.value(//put the value u want here);
        dialogToDate.value(//put the value you want here);
    }
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Waed Ayyad Profile Picture
    8,318 Super User 2025 Season 1 on at
    Set dialog value based on other dialog UI Builder x++
    Hi,
     
    You can utilize the registerOverrideMethod and add modified method to dialogPeriod , also you can check the following link it has the same idea:
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,281 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,019 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans