ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] table 5965 "Service Contract Header" - OnBeforeCheckCaseContract

Open gretanorv opened this issue 3 years ago • 2 comments

Hello, would it be possible to add OnBeforeCheckCaseContract, event to table 5965 "Service Contract Header", like this:

        field(5; Status; Enum "Service Contract Status")            trigger OnValidate() 
... 
                      case "Contract Type" of
                         "Contract Type"::Contract:
                             begin
                                IsHandled := false;
>                                 OnBeforeCheckCaseContract(Rec, IsHandled); //New Event
                                if not IsHandled then **begin**
...
                                   if ServLedgEntry."Amount (LCY)" <> 0 then
                                       StrToInsert := OpenPrepaymentEntriesExistTxt;
                                       if not ConfirmManagement.GetResponseOrDefault(
                                            StrSubstNo(CancelTheContractQst, StrToInsert), true)
                                       then begin
                                           Status := xRec.Status;
                                           exit;
                                       end;
                                   FiledServContract.FileContractBeforeCancellation(xRec);
                               end;
                           **end;**
                       "Contract Type"::Quote:
  
     [IntegrationEvent(false, false)]
    local procedure OnBeforeCheckCaseContract(var ServceContractHeader: Record "Service Contract Header"; var IsHandled: Boolean)  
     begin
     end; 

gretanorv avatar Apr 05 '23 11:04 gretanorv

Please correct this request, you code does not look good for implementation

AlexanderYakunin avatar Apr 19 '23 10:04 AlexanderYakunin

Hello, Thanks for bringing this to our attention. I have updated the request to show more details. The purpose of this event is the possibility to exit the code inside case of "Contract Type"::Contract

gretanorv avatar Apr 24 '23 12:04 gretanorv