Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

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

Posted on by 74
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
  • Suggested answer
    Deepak Agarwal Profile Picture
    Deepak Agarwal 148 on at
    Standard dialog extension - added new field + modified field value (on existing field)
    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. 
  • Layan Jwei Profile Picture
    Layan Jwei 7,347 Super User 2024 Season 2 on at
    Standard dialog extension - added new field + modified field value (on existing field)
    Hi,
     
    Is your question answered? If yes, then please verify the answers that helped.
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,347 Super User 2024 Season 2 on at
    Standard dialog extension - added new field + modified field value (on existing field)
    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
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,559 Super User 2024 Season 2 on at
    Standard dialog extension - added new field + modified field value (on existing field)
    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
  • devgirlX Profile Picture
    devgirlX 74 on at
    Standard dialog extension - added new field + modified field value (on existing field)
    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
  • Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,559 Super User 2024 Season 2 on at
    Standard dialog extension - added new field + modified field value (on existing field)
     
    can you share with us the business requirements ?
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,347 Super User 2024 Season 2 on at
    Standard dialog extension - added new field + modified field value (on existing field)
    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans