Not able to get proper result as required
Describe the bug
I want to delete one Field which I created through VS Code. means That field will be blank which I created in "Vendor Ledger Entry" when I delete that "Gen. Journal Line" table's one Line. In "Vendor Ledger Entry" : One Field : AlreadyDone : Boolean: Created In "Gen. Journal Line" : on Delete: Trigger : Want to write code to change values in "Vendor Ledger Entry" Issue is Using Setrange, fields Like "Applies-to ID" similar to "Applies-to ID" with "Gen. Journal Line". but one function "ClearCustVendApplnEntry;" clears that field "Applies-to ID" to blank. How Can I do the same with VS Code.
To Reproduce Steps and/or AL code to reproduce the behavior:
- Go to '[email protected]:RagRawat/Bank-Upload.git'
Expected behavior Need to clear my new field with that.
Versions: September 2018 (version 1.28) - 1.28.2 Business Central Fall 2018 update (CURRENT - 2018/08/27)
- Business Central: 13.0.24623.0
Find required event and write your code..
Yes, you will replace direct modifications with event triggers. Create a function in a custom codeunit like this:
[EventSubscriber(ObjectType::Table, DATABASE::"Gen. Journal Line", 'OnAfterDeleteEvent', '', true, true)]
local procedure ItemOnAfterDelete(var Rec: Record "Gen. Journal Line"; RunTrigger: Boolean);`
BEGIN
IF Rec.ISTEMPORARY THEN
EXIT;
<perform operations>
END;
Whenever a Gen. Journal Line gets deleted, whether or not the delete trigger is called, this function will be called (even from temp recs).
Yes, you will replace direct modifications with event triggers. Create a function in a custom codeunit like this:
[EventSubscriber(ObjectType::Table, DATABASE::"Gen. Journal Line", 'OnAfterDeleteEvent', '', true, true)]
local procedure ItemOnAfterDelete(var Rec: Record "Gen. Journal Line"; RunTrigger: Boolean);`
BEGIN
IF Rec.ISTEMPORARY THEN
EXIT;
<perform operations>
END;
Whenever a Gen. Journal Line gets deleted, whether or not the delete trigger is called, this function will be called (even from temp recs).