tableextension 50166 "FOR Sales Line Tbl Ext" extends "Sales Line" { fields { modify("Qty. Invoiced (Base)") { trigger OnAfterValidate() var begin HandleTrigger(triggerEnum::modify); end; } modify("Completely Shipped") { trigger OnAfterValidate() var begin HandleTrigger(triggerEnum::modify); end; } } trigger OnAfterInsert() var payload: JsonObject; payload_text: Text; data: JsonObject; begin HandleTrigger(triggerEnum::insert); end; trigger OnAfterModify() var payload: JsonObject; payload_text: Text; data: JsonObject; begin HandleTrigger(triggerEnum::modify); end; trigger OnBeforeDelete() var payload: JsonObject; payload_text: Text; data: JsonObject; begin HandleTrigger(triggerEnum::delete); end; trigger OnAfterDelete() begin simSH(triggerEnum::modify); end; local procedure HandleTrigger(triggerName: Enum TriggerEnum) var payload: JsonObject; payload_text: Text; data: JsonObject; sodata: JsonObject; Item: Record "Item"; itemdata: JsonObject; so: Record "Sales Header"; linePage: JsonObject; linesCU: Codeunit "Sales Orders"; begin // check if the record exists // if not sl.get(rec."Document Type", rec."Document No.", rec."Line No.") then exit; // working solution //check if the record is temporary // if rec.IsTemporary() then exit; // add rec info to data field Message('Sending Sales Line Trigger'); data := triggerData(); // line trigger to update sales line buildPayload.HandleTrigger(env.IsProduction(), Rec.CurrentCompany(), Rec.TableName(), data, triggerName); // sales order trigger to update sales order so.get(rec."Document Type", rec."Document No.");// faster than findset() -> for repeating and loooping. sodata := buildPayload.SalesHeaderData(so); sodata.Add('from', 'sales line sim'); buildPayload.HandleTrigger(env.IsProduction(), Rec.CurrentCompany(), so.TableName(), sodata, triggerEnum::modify); // item trigger to update page ats if not Item.Get(Rec."No.") then exit; itemdata := buildPayload.ItemData(Item); itemdata := buildPayload.ItemData(Item); buildPayload.HandleTrigger(env.IsProduction(), Rec.CurrentCompany(), Item.TableName(), itemdata, triggerName); end; }
I am trying to send an http request to an external application. I am really interested in knowing when a sales line is fully shipped. I originally did not have any fields but because the bottom triggers did not work on "Completely shipped" i added it manually.
I checked the field and it does not seem to be a flow field and it is just a boolean. Anybody know what might cause this to not fire my procedural when a sales line is completely shipped?
Hello Rodrigo- We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding, I would recommend discussing this on one of our communities.
I will open this up to the community in case they have something to add.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148