Skip to main content

Notifications

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

(6) ShareShare
ReportReport
Posted on by 31
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
  • Vahid Ghafarpour Profile Picture
    9,688 Super User 2025 Season 1 on at
    Missing custom fields restoring Quote Archive
    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! 😊
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    14,448 Super User 2025 Season 1 on at
    Missing custom fields restoring Quote Archive
    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.
  • Suggested answer
    Kamal Khakhkhar Profile Picture
    402 on at
    Missing custom fields restoring Quote Archive
    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 
  • CU28031029-0 Profile Picture
    6 on at
    Missing custom fields restoring Quote Archive

    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!

  • OscarFernandez Profile Picture
    31 on at
    Missing custom fields restoring Quote Archive
    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.
  • Suggested answer
    Kamal Khakhkhar Profile Picture
    402 on at
    Missing custom fields restoring Quote Archive
    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 

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans