Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

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

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
  • CU26071908-0 Profile Picture
    CU26071908-0 4 on at
    Writing a code to insert/update a table in a close method of a form.
    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.

     
  • Micheal Angel Profile Picture
    Micheal Angel 4 on at
    Writing a code to insert/update a table in a close method of a form.
    Hi @Waed Ayyad,
    Thank you for your response
  • Verified answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,332 Super User 2024 Season 2 on at
    Writing a code to insert/update a table in a close method of a form.
     
     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
     

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans