Skip to main content

Notifications

Announcements

No record found.

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

Disable and skip the mandatory property from the table level field in d365fo

(1) ShareShare
ReportReport
Posted on by 6
Hi ,
 
I am working on HR module where i worked on Loan item equipment form , where i don't need the loan item field because at the place of loan item , i need inventory item id field , but while creating new record on form , it is showing Filed Loan must be filled in .
 
when i am trying to change mandatory properties thru extension , it is not allowing me , 
 
i have written code on form data source level ,but it is not working
 
 public boolean validateWrite()
    {
        boolean         ret                     = next validateWrite();
        FormRun        formRun                  = this.formRun() as FormRun;
        Formdatasource FrmDataSource_ds         = this.formRun().dataSource(formDataSourceStr(HcmPersonLoan,HcmPersonLoan));
        HcmPersonLoan  hcmPersonLoan ;
        hcmPersonLoan = FrmDataSource_ds.cursor();

        if(!hcmPersonLoan.Loan)
        {
            ret = FrmDataSource_ds.object(fieldNum(HcmPersonLoan, Loan)).mandatory(false);
        }
        return ret;
    }
 
 
please look in to this , and provide me the solution.
  • Suggested answer
    Judecarey Profile Picture
    Judecarey 9 on at
    Disable and skip the mandatory property from the table level field in d365fo
    It seems that you are experiencing an issue with the Loan item field in your HR module. You want to replace it with the Inventory item ID field but are unable to change the mandatory properties through extension. You have written code on the form data source level, but it is not working as expected. I would suggest reviewing your code and ensuring that the changes you are trying to make are implemented correctly. Additionally, you may want to check if there are any other dependencies or validations related to the Loan item field that need to be addressed.
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,605 Most Valuable Professional on at
    Disable and skip the mandatory property from the table level field in d365fo
    The table itself requires the field to be filled in. You're not allowed to override it in a form and start creating invalid records.
     
    The table links people and and what was loaned, so these two pieces are information are always needed. Maybe it's not the the right table for your business requirements. But I suggest you respect the data model and use LoanItemId on HcmLoanItem, instead of trying to ignore HcmLoanItem table and move ItemId directly to HcmPersonLoan. Your design would also mean that a loan can't contain more than one item.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,605 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans