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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
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.
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,740 Most Valuable Professional on at
    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.
  • Suggested answer
    Judecarey Profile Picture
    9 on at
    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 577 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 309

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans