Skip to main content

Notifications

Announcements

No record found.

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.
  • 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 231,317 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,317 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans