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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Update the value of contract field

(3) ShareShare
ReportReport
Posted on by 6,476
Hello,
On one of the contract dialogs, we need to add new field. let's call it "DescriptionField".
On the dialog, we also have a lookup field where we select the mode of delivery.
What I want to achieve is that, by selecting (or modifying) the mode of delivery value, new DescriptionField must be automatically updated with the value... eg. "ModeOfDelivery + Date".
How can I achieve it and where should my code be placed?
We have Controller, Contract, Service and UIBUilder classes
Categories:
I have the same question (0)
  • Suggested answer
    Layan Jwei Profile Picture
    8,049 Super User 2025 Season 2 on at
    Update the value of contract field
    Hi Johnny,


    So you want whenever you modify the mode of delivery field, then the description needs to be populated with sth.

    So you need to registerOverride the modified method of the Mode of delivery field in the postRun method in the ui builder class, and inside the method you can set the values.
     
    So maybe sth like that:
     
     
    public void postRun()
    {
        super();
    
        // Override modified method
        dialogDeliveryMode.registerOverrideMethod(methodStr(FormStringControl, modified),methodStr(UIBuilderClass, deliveryMode_modified),this);
    }
    
    private boolean deliveryMode_modified(FormStringControl _control)
    {
        this.modifyDialogFields();
    
        return _control.modified();
    }
    
    private void modifyDialogFields()
    {
        dialogDescription.value(//put the value u 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.

  • Layan Jwei Profile Picture
    8,049 Super User 2025 Season 2 on at
    Update the value of contract field
    Hi,

    Is your issued fixed? if yes, then please verify the answer if it helped.
  • Johnny Profile Picture
    6,476 on at
    Update the value of contract field
    Hi Layan,
    thanks for the solution.
    It works if I put the code in the same class where "Payment mode" dialogField is defined. But I have to use the extension of the UIBuilder class.
    In original UIBuilder class paym mode is defined as private "private DialogField dialogPaymMode;".
    How could I reach this private veriable? Or what would be a workoaround for extension?
    Thanks
  • Layan Jwei Profile Picture
    8,049 Super User 2025 Season 2 on at
    Update the value of contract field
    Hi Johnny,

    What's the standard class name u are trying to create an extension for?
  • Johnny Profile Picture
    6,476 on at
    Update the value of contract field
    Hi Layan,
    it is an ISV class.
  • Layan Jwei Profile Picture
    8,049 Super User 2025 Season 2 on at
    Update the value of contract field
    Hi,

    Does this ISV class already has code for the modified method, if yes then you can add code to it directly?
    if not, then as a workaround, maybe create a new variable and try and define in the postBuild method and use it instead in the postRun method?
    but this might cause issues in the future, if the ISV add code to the modified method maybe -- so maybe it's better to contact them
     
    dialogField dialogDeliveryMode;
    
    public void postBuild()
    {
        dialogDeliveryMode = this.bindInfo().getDialogField(this.dataContractObject(), methodstr(YourContractClass,parmDeliverMode));
    }
    
    

    can u share the ISV class with us?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 813

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 738 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 566 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans