Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Disable a part of Third party code

Posted on by 295

My third party 's page extension code has a part to prevent to enter Transfer order line.

trigger OnInsertRecord(BelowxRec: Boolean): Boolean
var
TransferLine: Record "Transfer Line";


begin
TransferLine.SetRange("Document No.", Rec."Document No.");
TransferLine.setfilter("Release Prod. Order No.", '<>%1', '');

if not TransferLine.IsEmpty then

error('You can not add new lines in case this Transfer Order is used to transfer for Production orders');
end;

How can I disable it through my code ?

Thank you.

  • Hoang Ng Profile Picture
    Hoang Ng 295 on at
    RE: Disable a part of Third party code

    Thanks Nitin.

    If there is no way to overwrite on 3rd code, I think I will show the new page, user selects items, then I will use your suggested code to insert the transfer lines.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Disable a part of Third party code

    Then you can not avoid this, if you have source code available with you, you can write your own logic how you can prevent this insertion code.

    Thanks.

  • Hoang Ng Profile Picture
    Hoang Ng 295 on at
    RE: Disable a part of Third party code

    Thanks Nitin,

    I don't use code to insert transfer line. User enters it just by adding new line.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Disable a part of Third party code

    Hi,

    When you write a code to insert new records to this table, write as per below

    Rec.Insert(false);

    or Rec.Insert();

    Thanks.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans