Skip to main content

Notifications

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,479
 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
  • Verified answer
    Dineshkarlekar Profile Picture
    1,479 on at
    To info itemid ,warehouse and physical inventory when invent trans update
    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
  • André Arnaud de Calavon Profile Picture
    294,137 Super User 2025 Season 1 on at
    To info itemid ,warehouse and physical inventory when invent trans update
    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.
  • Suggested answer
    Waed Ayyad Profile Picture
    8,258 Super User 2025 Season 1 on at
    To info itemid ,warehouse and physical inventory when invent trans update
    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
     
  • Bharani Preetham Peraka Profile Picture
    3,624 Moderator on at
    To info itemid ,warehouse and physical inventory when invent trans update
    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.
  • Dineshkarlekar Profile Picture
    1,479 on at
    To info itemid ,warehouse and physical inventory when invent trans update
    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));
            }
        }
    }
     
  • Layan Jwei Profile Picture
    7,778 Super User 2025 Season 1 on at
    To info itemid ,warehouse and physical inventory when invent trans update
    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,479 on at
    To info itemid ,warehouse and physical inventory when invent trans update
    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)
        {
    
        }
    }
    
     

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,137 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,877 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans