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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Writing a code to insert/update a table in a close method of a form.

(1) ShareShare
ReportReport
Posted on by 4
Hi Everyone,
 
I have a requirement like updating or creating a Role Id for a Resource based on a customized field in the Resource setup form in Resource list page, so role Id for a resource is stored in /ResourceResourceCategorySetup/ table, is it a right approach to implement a logic in close method of Resource setup form so once user finishes setting up value in the customized field and closes the form, Role Id will be inserted or updated into ResourceResourceCategorySetup table?
 
Thanks
I have the same question (0)
  • Verified answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
     
     Depending on your requirement you want to create the Role Id only on this form, so you can implement your solution on the Write method on your form DataSource, but if your logic is not limited to this form, you can add your logic on the insert and update method of the table.
     
     
     
     
     
     
     
    Regards,
    Waed Ayyad
     
    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
     
  • Micheal Angel Profile Picture
    4 on at
    Hi @Waed Ayyad,
    Thank you for your response
  • CU26071908-0 Profile Picture
    on at
    Implementing the logic to update or create a Role Id for a resource based on a customized field in the Resource setup form, and storing the Role Id in the /ResourceResourceCategorySetup/ table, can be achieved by placing the logic in the close method of the Resource setup form. This approach ensures that the Role Id is only updated or created once the user has finished setting up the value in the customized field and closes the form. This method can help maintain data integrity and ensures that the information is not prematurely updated during the form interaction. However, it's crucial to ensure that the close method is correctly handling all possible scenarios, including validation checks and potential error handling, to prevent any issues during the data update process. This approach can be considered appropriate if the resource setup form's close method is designed to handle such logic and is a part of the standard workflow for updating resource details.

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans