microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
728 stars 241 forks source link

Event request for handling error message for UpdateSelltoContactNo function in job table #7601

Closed srkkoneti closed 9 months ago

srkkoneti commented 9 months ago

[Uploading Event Required in Jobs 1.docx…]() We need an Event in Job (167) Table

Additional Code was added to Sell-to Contact No. (OnValidate Trigger).

on validate of “Bill-To Contact No.” we have handled an Error message

In UpdateBillToCust(ContactNo:Code[20])

A screenshot of a computer program

Description automatically generated

Here a separate function was created to handle the error message.

Same As “Bill-To Contact No.” we would like to handle the Error Messages For “Sell-To Contact No.” That error message is called in UpdateSellToCust(ContactNo:Code[20) function.

To handle this error message

please create a separate function just like Bill-To Contact No. and then add an event to handle the Error Message.

A function that needs to be created for handling:

i.e:

local procedure ShowSellToContactBusinessRelationNotFoundError() 

var 

    IsHandled: Boolean; 

begin 

    IsHandled := false; 

    OnBeforeShowSellToContactBusinessRelationNotFoundError(Rec, Contact, IsHandled); 

    if IsHandled then 

        exit; 

    Error(ContactBusRelMissingErr, Contact."No.", Contact.Name); 

end; 

call this above function after the If condition.

i.e: if not ContactBusinessRelationFound then (this condition was there in UpdateSellToCust(ContactNo:Code[20)) function.

A screenshot of a computer

Description automatically generated

Syntax of required event:

[IntegrationEvent(false, false)]

local procedure OnBeforeShowSellToContactBusinessRelationNotFoundError(var Job: Record Job; Contact: Record Contact; var IsHandled: Boolean)

begin

end;

dannoe commented 9 months ago

This is the wrong repository to request events. Please close this issue and create a new issue here: https://github.com/Microsoft/ALAppExtensions