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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Standard dialog extension - added new field + modified field value (on existing field)

(1) ShareShare
ReportReport
Posted on by 114
Hello,
I extended standard dialog that appears when you want to post cust interest note.
I added this field 'Due date'
And I want to that due date to be filled based on the value that user enters in Posting date
 
 
How can I achieve this?
Thanks in advance
I have the same question (0)
  • Suggested answer
    Layan Jwei Profile Picture
    8,284 Super User 2026 Season 2 on at
    Hi,
     
    What is the standard class? I'm assuming you added the field to a contract class? Then you can use UI builder class to achieve your result
     
    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
  • Mohamed Amine Mahmoudi Profile Picture
    26,826 Super User 2026 Season 1 on at
     
    can you share with us the business requirements ?
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • devgirlX Profile Picture
    114 on at
    I extender CustInterestPost which is RunBaseBatch class.
     
    Business requirement is that when customer posts interest journal:
     
     
    This due date (which I added also through extension of the table and form) should be filled with the value from dialog that appears when you click post:
     
    And this due date here should be populated and calculated based on Posting date, whatever you type in posting date it should add amount of days defined in terms of payment on customer:
     
    So for example you enter posting date 27.3.2024 and if on customer terms of payment are 30 days, this due date should be 26.4.2024
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,826 Super User 2026 Season 1 on at
    Hi,
     
    you must extend the run method.
    try this
    [ExtensionOf(ClassStr(CustInterestPost))]
    final class CustInterestPost_Extension
    {
        public void run()
        {
    		next run();
    		ttsbegin;
            CustInterestJour custInterestJour = CustInterestJour::find(this.parmCustInterestJour.RecId, true);
            custInterestJour.due = this.postingDate();
            custInterestJour.update();
            ttscommit;
        }
    }
    Best regards,
    Mohamed Amine MAHMOUDI
  • Suggested answer
    Layan Jwei Profile Picture
    8,284 Super User 2026 Season 2 on at
    Hi DevGirl,

    Maybe try sth like that:
    [ExtensionOf(classStr(CustInterestPost))]
    final class CustInterestPost_Extension
    {
        public TransDate    dueDate;
        public DialogField  dialogDueDate;
    
        public Object dialog()
        {
            DialogRunbase dialog;
    
            dialog = next dialog();
    
            dialogDueDate = dialog.addFieldValue(extendedTypeStr(TransDate), DateTimeUtil::addMonths(this.postingDate(), 1), "DueDate");
    
            dialog.allowUpdateOnSelectCtrl(true);
    
            return dialog;
        }
    
        public void dialogSelectCtrl()
        {
            next dialogSelectCtrl();
    
            dialogDueDate.value(DateTimeUtil::addMonths(dialogPostingDate.value(), 1));
        }
    
        public boolean getFromDialog()
        {
            boolean ret;
    
            ret = next getFromDialog();
    
            if(ret)
            {
                dueDate = dialogDueDate.value();
            }
            return ret;
        }
    
        protected TransDate dueDate(TransDate _dueDate = dueDate)
        {
            dueDate = _dueDate;
            return dueDate;
        }
    
    public void run()
    {
        next run();

        ttsbegin;
        CustInterestJour custInterestJour;
        select forupdate custInterestJour where custInterestJour.RecId == parmCustInterestJour.RecId;
        if(custInterestJour)
        {
            custInterestJour.DueDate = this.dueDate();
            custInterestJour.update();
        }
        ttscommit;
    } }

    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,284 Super User 2026 Season 2 on at
    Hi,
     
    Is your question answered? If yes, then please verify the answers that helped.
  • Suggested answer
    Deepak Agarwal Profile Picture
    9,287 Super User 2026 Season 2 on at
    Did you explored UI BuilderClass, reffer CustAccountStatementIntUIBuilder class for some examples. 

    Also, if the due date needs to come based on other date, do you really need to keep this as parameter, why not to calculate this in code directly. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 345 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 304

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans