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 :
Finance | Project Operations, Human Resources, ...
Answered

To info itemid ,warehouse and physical inventory when invent trans update

(1) ShareShare
ReportReport
Posted on by 1,836
 HI ,everyone,
I was trying to info the itemid ,warehouse and physical inventory when invent trans update  , can you please suggest me hou can i get this done i am trying to do it on table post event handler , my code is below , please guide me on this .
 
 
thanks,
Regards,
Dinesh
I have the same question (0)
  • Dineshkarlekar Profile Picture
    1,836 on at
    here is my code 
    class DTUpdateInventTrans_Eventhandler
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        [PostHandlerFor(tableStr(InventTrans), tableMethodStr(InventTrans, update))]
        public static void InventTrans_Post_update(XppPrePostArgs args)
        {
    
        }
    }
    
     
  • Layan Jwei Profile Picture
    8,118 Super User 2025 Season 2 on at
    Hi Dinesh,

    your code is empty --- can you at least show us what you tried?
    Also use chain of command instead of event handlers.

    what is your requirement? do you want to print those values each time an update happens, regardless from where?
  • Dineshkarlekar Profile Picture
    1,836 on at
    hi thanks for reply,
     
    My code is below please suggest me changes , i have tried the info after the sales order invoiced but the info is not getting done .
    class DTUpdateInventTrans_Eventhandler
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        [PostHandlerFor(tableStr(InventTrans), tableMethodStr(InventTrans, update))]
        public static void InventTrans_Post_update(XppPrePostArgs args)
        {
            InventTrans   inventTrans = args.getThis();
            InventDim     inventDim;
            select InventLocationId from inventDim
                where inventDim.inventDimId ==  inventTrans.inventDimId;
           // != inventTrans.orig().Qty)
            if (inventTrans.Qty)
            {
                info(strFmt("inventTrans.ItemId: %1,inventDim.inventLocationId: %2,inventTrans.Qty: %3,inventTrans.orig().Qty: %4",inventTrans.ItemId,inventDim.inventLocationId,inventTrans.Qty,inventTrans.orig().Qty));
            }
        }
    }
     
  • Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    when invent trans update
     
    This particular phrase doesn't give any information about the requirement. If you write your code when update of this table, which can happen in multiple ways where the infolog is irrelevant. So, I need complete requirement to resolve this and your code is the not right place.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi Dinesh,
     
    Do you want to display info message when you update any record in the table?  If yes, try to use COC on the update method you can add something like below:
     
    public void update ()
    {
       next update();
    
      //Your info statement
    }
    Also did you try to trace the code?
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • André Arnaud de Calavon Profile Picture
    301,194 Super User 2025 Season 2 on at
    Hi Dinesh,
     
    When coming across this question, I wonder about the business requirement for having an info. What problem are you trying to solve? I don't think it is a valid requirement to have an info message when updating inventtrans records.
  • Verified answer
    Dineshkarlekar Profile Picture
    1,836 on at
    hi , 
    thanks for reply ,
     
    It was customisation related requirement , so i was trying to info the message for that , i have done the code on post run of inventtrans  and getting desired output .my issue is resolved as of now .
     
     
    thanks,
    Regards,
    Dinesh

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans