ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] codeunit 5817 "Undo Posting Management" - Enhance event OnUpdateSalesLineOnBeforeInitOustanding

Open alessandrovecchio opened this issue 5 years ago • 3 comments

Hi, in event OnUpdateSalesLineOnBeforeInitOustanding it would be useful to add the source record (that mease for example Sales Shipment Line) in order to have all information related to any customization and let us to update SalesLine according to our customization. Now I'm not able to retrieve information about the correction except UndoQty passed as parameter. Having Sales Shipment Line record would help us to update other custom fields.

As suggestion:

  • UpdateSalesLine function call in "Undo Posting Management" codeunit: add SourcePostedDoc: variant (SalesShptLine in my example) record as parameter
  • UndoPostingMgt.UpdateSalesLine call in "Undo Sales Shipment Line" codeunit: pass SalesShptLine record for SourcePostedDoc parameter
  • OnUpdateSalesLineOnBeforeInitOustanding event in "Undo Posting Management": pass new parameter SourcePostedDoc received

I hope that our need is clear. Thank you

alessandrovecchio avatar Sep 17 '21 16:09 alessandrovecchio

We cannot change UpdateSalesLine function's signature, because it is global and that would be a breaking change. There is a OnAfterUpdateSalesLine(SalesLine, SalesShptLine); after the call you mention in the UndoSalesShipmentLine. Can you use that instead? If not, you can request an event, but it shouldn't include modifying a global function ask to pass a parameter

Stepanenko-Vadim avatar Sep 21 '21 05:09 Stepanenko-Vadim

Hi, thank you.

Unfortunately I cannot use OnAfterUpdateSalesLine (that was my first choice) because inside UpdateSalesLine many validation on Sales Line are made and I need to prepare Sales Line record before.

Can I suggest to add a new event like:

OnBeforeUpdateSalesLine(SalesLine, SalesShptLine,IsHandled)

And put it before UndoPostingMgt.UpdateSalesLine / UndoPostingMgt.UpdatePurchLine call?

Maybe this could be enough. This should be done similar for codeunit

  • "Undo Sales Shipment Line" * New event OnBeforeUpdateSalesLine(SalesLine, SalesShptLine,IsHandled)
  • "Undo Purchase Receipt Line" * Exists OnUpdateOrderLineOnBeforeUpdateSalesLine but PurchLine must be added
  • "Undo Return Receipt Line" * Exists OnUpdateOrderLineOnBeforeUpdateSalesLine but SalesLine must be added
  • "Undo Return Shipment Line" * Exists OnUpdateOrderLineOnBeforeUpdatePurchLine but PurchLine must be added

Do you think this can be a good compromise?

Thank You Alessandro Vecchio

Da: Vadim Stepanenko @.> Inviato: martedì 21 settembre 2021 08:00 A: microsoft/ALAppExtensions @.> Cc: Alessandro Vecchio @.>; Author @.> Oggetto: Re: [microsoft/ALAppExtensions] [Event Request] codeunit 5817 "Undo Posting Management" - Enhance event OnUpdateSalesLineOnBeforeInitOustanding (#14373)

We cannot change UpdateSalesLine function's signature, because it is global and that would be a breaking change. There is a OnAfterUpdateSalesLine(SalesLine, SalesShptLine); after the call you mention in the UndoSalesShipmentLine. Can you use that instead? If not, you can request an event, but it shouldn't include modifying a global function ask to pass a parameter

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FALAppExtensions%2Fissues%2F14373%23issuecomment-923653857&data=04%7C01%7Calessandro.vecchio%40eos-solutions.it%7C6a2caa2c4bdb41567f4708d97cc5117f%7Ccdd2b2ff69af49e39161680fb58a011d%7C0%7C0%7C637678008145673717%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UGgQ6YCqPIHGp95IIXrewNOiD%2F39yDvIlcOeOQoqPEQ%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALZRTTGV6LWGIBLIKPZQAB3UDANOJANCNFSM5EH5MARA&data=04%7C01%7Calessandro.vecchio%40eos-solutions.it%7C6a2caa2c4bdb41567f4708d97cc5117f%7Ccdd2b2ff69af49e39161680fb58a011d%7C0%7C0%7C637678008145673717%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ZceY8dH65lyL987ib8WnnmGviZ7SDFO5vFnCOF4kmP4%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Calessandro.vecchio%40eos-solutions.it%7C6a2caa2c4bdb41567f4708d97cc5117f%7Ccdd2b2ff69af49e39161680fb58a011d%7C0%7C0%7C637678008145683710%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xoKe7RS1X6gBwWmw7mxOE4dMUbXjPbdFFU9KdMUqbGI%3D&reserved=0 or Androidhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Calessandro.vecchio%40eos-solutions.it%7C6a2caa2c4bdb41567f4708d97cc5117f%7Ccdd2b2ff69af49e39161680fb58a011d%7C0%7C0%7C637678008145693704%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ks7eKufeVd3vwwUk%2FSK1lMiQ13JXK%2FaThlAyRS%2BThF4%3D&reserved=0.

alessandrovecchio avatar Sep 21 '21 08:09 alessandrovecchio

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

JesperSchulz avatar Sep 23 '21 12:09 JesperSchulz