Cannot insert date to warehouse activity header table

samantha73samantha73 Member Posts: 106
Hi Guys
I'm trying to insert current date when a warehouse activity (inventory pick ) is created and thought it would be simple but below code is not working:
Table extension- Warehouse Activity Header .(inventory Pick) also tried "validate":

trigger OnAfterInsert()

begin

Rec."Posting Date" := WorkDate();

Rec.Modify();

Answers

  • irasoelbaksirasoelbaks Member Posts: 119
    Is the trigger being fired? Please check that first by using the debugger for example.
  • samantha73samantha73 Member Posts: 106
    looks like some other code is overwriting basic trigger actions perhaps a code unit but I cannot find it
  • irasoelbaksirasoelbaks Member Posts: 119
    edited 2021-02-23
    The OnInsert trigger can be skipped ofcourse by using Rec.INSERT(False). The False implies a skip of the OnInsert trigger. So Rec.Insert(True) wil respect the OnInsert trigger logic during a record insert.
    If you would like to find out which events are 'published' or 'subscribing' to your table:
    BC:
    I don't think there is something for it. But if I would like to find out which events are subscribing to an object I create a simple Page of Type List with source table. Example:

    5f9877pje54h.png

    page 50102 "Event List"
    {

    ApplicationArea = All;
    Caption = 'Event List';
    PageType = List;
    SourceTable = "Event Subscription";
    UsageCategory = Lists;

    layout
    {
    area(content)
    {
    repeater(General)
    {
    field("Active Manual Instances"; Rec."Active Manual Instances")
    {
    ApplicationArea = All;
    }
    field("Error Information"; Rec."Error Information")
    {
    ApplicationArea = All;
    }
    field("Event Type"; Rec."Event Type")
    {
    ApplicationArea = All;
    }
    field("Number of Calls"; Rec."Number of Calls")
    {
    ApplicationArea = All;
    }
    field("Originating App Name"; Rec."Originating App Name")
    {
    ApplicationArea = All;
    }
    field("Originating Package ID"; Rec."Originating Package ID")
    {
    ApplicationArea = All;
    }
    field("Published Function"; Rec."Published Function")
    {
    ApplicationArea = All;
    }
    field("Publisher Object ID"; Rec."Publisher Object ID")
    {
    ApplicationArea = All;
    }
    field("Publisher Object Type"; Rec."Publisher Object Type")
    {
    ApplicationArea = All;
    }
    field("Subscriber Codeunit ID"; Rec."Subscriber Codeunit ID")
    {
    ApplicationArea = All;
    }
    field("Subscriber Function"; Rec."Subscriber Function")
    {
    ApplicationArea = All;
    }
    field("Subscriber Instance"; Rec."Subscriber Instance")
    {
    ApplicationArea = All;
    }
    field(Active; Rec.Active)
    {
    ApplicationArea = All;
    }

    }
    }
    }

    }


    Nav:
    b1suarrbtz3l.png
  • samantha73samantha73 Member Posts: 106
    Thanks this query helped a lot
Sign In or Register to comment.