ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Codeunit 22 "Item Jnl.-Post Line", function InsertApplEntry enhancement

Open alessandrovecchio opened this issue 5 years ago • 3 comments

Hi, sometimes we need to adjust Item Application Entry validanting custom fields coming from Item Ledger Entry. Now when this function is called, I have very limitated possibility to update ItemApplnEntry record.

In my specific case, I need to fill a custom field "quantity 2", but because of the function is called from different contexts and passed parameters has no recordset type, I'm not able to understand fomr which part of the codeunit the function has been fired.

The only solution that I found, is to ask for adding event OnAfterItemApplnEntryInsert... every time it is called. That means that

  • InsertApplEntry should have as var parameter a ItemApplnEntry record that will be filled inside the function i.e. as is

                 InsertApplEntry(
                    GlobalItemLedgEntry."Entry No.", GlobalItemLedgEntry."Entry No.",
                    "Applies-from Entry", 0, GlobalItemLedgEntry."Posting Date",
                    GlobalItemLedgEntry.Quantity, true);
    

to be

               InsertApplEntry(
                  GlobalItemLedgEntry."Entry No.", GlobalItemLedgEntry."Entry No.",
                  "Applies-from Entry", 0, GlobalItemLedgEntry."Posting Date",
                  GlobalItemLedgEntry.Quantity, true,NewItemApplEntry);
  • after every call, an event should be added where it doesn't exists, or extended where it is already there i.e. as is

              OnItemQtyPostingOnAfterInsertApplEntry(ItemJnlLine, TempSplitItemJnlLine, GlobalItemLedgEntry);
    

to be

            OnItemQtyPostingOnAfterInsertApplEntry(ItemJnlLine, TempSplitItemJnlLine, GlobalItemLedgEntry,NewItemApplEntry);

this is needed for every InsertApplEntry function call.

If you have any other suggestion or workaround, it could be great. Thank you

alessandrovecchio avatar Sep 17 '21 15:09 alessandrovecchio

Hello Alessandro! As ItemApplnEntry record which is used inside of InsertApplnEntry is global variable, you already have full access to this variable after any InsertApplnEntry call. Therefore, no need to change parameters of this procedure. I'd suggest you close this request and create normal event requests for each event you need after InsertApplnEntry, as they may need different parameters for your solution. Another possible option is to use OnAfterItemApplnEntryInsert(ItemApplnEntry, GlobalItemLedgEntry, OldItemLedgEntry); event, if you can adopt more generic approach. Please add reference to this request in new event requests to help us track this to completion.

AlexanderYakunin avatar Oct 20 '21 09:10 AlexanderYakunin

Thank you, I will close this issue and create a new issue for every specific event that I will found as needed-

Regards. AV

Da: Alexander Yakunin @.> Inviato: mercoledì 20 ottobre 2021 11:01 A: microsoft/ALAppExtensions @.> Cc: Alessandro Vecchio @.>; Author @.> Oggetto: Re: [microsoft/ALAppExtensions] Codeunit 22 "Item Jnl.-Post Line", function InsertApplEntry enhancement (#14371)

Hello Alessandro! As ItemApplnEntry record which is used inside of InsertApplnEntry is global variable, you already have full access to this variable after any InsertApplnEntry call. Therefore, no need to change parameters of this procedure. I'd suggest you close this request and create normal event requests for each event you need after InsertApplnEntry, as they may need different parameters for your solution. Another possible option is to use OnAfterItemApplnEntryInsert(ItemApplnEntry, GlobalItemLedgEntry, OldItemLedgEntry); event, if you can adopt more generic approach. Please add reference to this request in new event requests to help us track this to completion.

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%2F14371%23issuecomment-947468813&data=04%7C01%7Calessandro.vecchio%40eos-solutions.it%7Cffb418240f7b4b18653c08d993a838f9%7Ccdd2b2ff69af49e39161680fb58a011d%7C0%7C0%7C637703172996114865%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=DplV7SW5K02o3FM70p79wUiv81%2FPmhxJyWO3wetkA7E%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALZRTTHAN4TWZSYO6KTUQ4TUH2AOPANCNFSM5EHWBTAA&data=04%7C01%7Calessandro.vecchio%40eos-solutions.it%7Cffb418240f7b4b18653c08d993a838f9%7Ccdd2b2ff69af49e39161680fb58a011d%7C0%7C0%7C637703172996124846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uFc6sZsxQg7QDgtKUcWXWT1sDEwLIbMt9%2Fy6WMO5h3g%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%7Cffb418240f7b4b18653c08d993a838f9%7Ccdd2b2ff69af49e39161680fb58a011d%7C0%7C0%7C637703172996134841%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=p%2Fkkd8gHtJKAtyMhFeOWgy8OfQ%2BzA4ycJs6dmnr7CyM%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%7Cffb418240f7b4b18653c08d993a838f9%7Ccdd2b2ff69af49e39161680fb58a011d%7C0%7C0%7C637703172996144834%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=NGjKZ2WcyZXSvcTHangt1aopBj0Y0LdKWaiczLkADKg%3D&reserved=0.

alessandrovecchio avatar Oct 20 '21 09:10 alessandrovecchio

Issue closed, different specific event request will be opened if needed. Thank you

alessandrovecchio avatar Oct 20 '21 09:10 alessandrovecchio