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 :
Small and medium business | Business Central, N...
Suggested Answer

Missing custom fields restoring Quote Archive

(5) ShareShare
ReportReport
Posted on by 45
Hi,
 
I´ve noticed in the latest 25 release that my custom fields in the Sales Line table are archived correctly but when I try to restore the Quote they are lost.
Checking the base code of BC after transfering the fields from the Sales Line Archive to the Sales Line it runs a Validate of the No. field, this triggers the code bellow that clears the custom fields 
 
 
I took for granted that in any element of the system the archive and restore process of a custom fields was made by default.
 
thanks in advance
I have the same question (0)
  • Suggested answer
    Kamal Khakhkhar Profile Picture
    1,282 on at
    Hii there,
    You can update event to OnValidateNoOnAfterUpdateUnitPrice as per this you can get your data without any lost due to init or use onaftervalidate() for no.
     
    If you found answer please mark it answered.
     
    Thank You,
    Kamal Khakhkhar 
  • OscarFernandez Profile Picture
    45 on at
    Thanks for the answer, 
    Yes, I subscribed to an event as a workaround but I found extrange this behaviour of the system as now I cannot trust the archive/restore process for the rest of the emelents in the system regarding my custom fields.
  • CU28031029-0 Profile Picture
    6 on at

    It looks like the issue happens because when the No. field is validated during the restore process, it triggers code that clears the custom fields.

     

    By default, Business Central archives custom fields correctly, but restoring them isn't always automatic, especially if the standard validation logic resets them.

     

    To fix this, you may need to manually transfer the custom fields from Sales Line Archive to Sales Line after the standard restore process. You can do this by extending the restore functionality with an event subscriber or modifying the process to include your custom fields.

     

    Let me know if you need more details on how to implement this!

  • Suggested answer
    Kamal Khakhkhar Profile Picture
    1,282 on at
    Hii there,
    As per requirement you need to add all the fields in use event of
    CU -ArchiveManagement
    event -OnAfterRestoreSalesLines  in this event you need to assign the custom field value of sales line archive to sales line.  So it will flow . You can do validate () also if you require..
     
    As per i check it's same code is written in base action of restore documents in archive sales quotas 
     
     
    Mark it answered if you found answer.
     
    Thank you.
    Kamal Khakhkhar 
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,443 Super User 2025 Season 2 on at
    Your custom fields are lost because the Init() function clears them during the restore process when Validate("No.") is triggered. To fix this, ensure the fields are explicitly restored after validation or modify Init() to preserve them.
  • Vahid Ghafarpour Profile Picture
    12,166 Super User 2025 Season 2 on at
    If any of the responses helped resolve your issue, please take a moment to mark the best answer. This helps others in the community quickly find solutions to similar problems.

    To do this, simply click the "Does this answer your question?" button on the most helpful response and like the helpful posts. If your issue is still unresolved, feel free to provide more details so the community can assist further!

    Thanks for being an active part of the Dynamics 365 Community! 😊

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,362

#2
YUN ZHU Profile Picture

YUN ZHU 867 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans