ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit Transfer Extended Text

Open MattiLE opened this issue 7 years ago • 0 comments

Hi AL team,

we have modified the extended text logic. For these modifications I need new publishers and additional parameters in existing publishers. The following publishers have been extended by the parameter Unconditionally:

LOCAL PROCEDURE OnSalesCheckIfAnyExtTextAutoText@25(VAR ExtendedTextHeader@1000 : Record 279;VAR SalesHeader@1001 : Record 36;VAR SalesLine@1002 : Record 37;Unconditionally@5048250 : Boolean);
LOCAL PROCEDURE OnReminderCheckIfAnyExtTextAutoText@26(VAR ExtendedTextHeader@1000 : Record 279;VAR ReminderHeader@1001 : Record 295;VAR ReminderLine@1002 : Record 296;Unconditionally@5048250 : Boolean);
LOCAL PROCEDURE OnFinChrgMemoCheckIfAnyExtTextAutoText@24(VAR ExtendedTextHeader@1000 : Record 279;VAR FinanceChargeMemoHeader@1001 : Record 302;VAR FinanceChargeMemoLine@1002 : Record 303;Unconditionally@5048250 : Boolean);
LOCAL PROCEDURE OnPurchCheckIfAnyExtTextAutoText@27(VAR ExtendedTextHeader@1000 : Record 279;VAR PurchaseHeader@1001 : Record 38;VAR PurchaseLine@1002 : Record 39;Unconditionally@5048250 : Boolean);
LOCAL PROCEDURE OnServCheckIfAnyExtTextAutoText@28(VAR ExtendedTextHeader@1000 : Record 279;VAR ServiceHeader@1001 : Record 5900;VAR ServiceLine@1002 : Record 5902;Unconditionally@5048250 : Boolean);

I also need a new Publisher in the Insert functions with the Handled parameter.

[External]
PROCEDURE InsertSalesExtTextRetLast@34(VAR SalesLine@1000 : Record 37;VAR LastInsertedSalesLine@1002 : Record 37);
 // NEW BEG
 OnBeforeInsertSalesExtText(SalesLine,TempExtTextLine,IsHandled);
 IF IsHandled THEN
   EXIT;
 // NEW END
 ToSalesLine.RESET;
 ToSalesLine.SETRANGE("Document Type",SalesLine."Document Type");

LOCAL PROCEDURE OnBeforeInsertSalesExtText@5048251(VAR SalesLine@5048250 : Record 37;VAR TempExtTextLine@5048251 : TEMPORARY Record 280;VAR IsHandled@5048253 : Boolean);


[External]
PROCEDURE InsertReminderExtText@13(VAR ReminderLine@1000 : Record 296);
 // NEW BEG 
 OnBeforeInsertReminderExtText(ReminderLine,TempExtTextLine,IsHandled);
 IF IsHandled THEN
   EXIT;
 // NEW END;
 ToReminderLine.RESET;
 ToReminderLine.SETRANGE("Reminder No.",ReminderLine."Reminder No.");

LOCAL PROCEDURE OnBeforeInsertReminderExtText@5048250(VAR ReminderLine@5048250 : Record 296;VAR TempExtTextLine@5048251 : TEMPORARY Record 280;VAR IsHandled@5048253 : Boolean);


[External]
PROCEDURE InsertFinChrgMemoExtText@16(VAR FinChrgMemoLine@1000 : Record 303);
 // NEW BEG
 OnBeforeInsertFinChrgMemoExtText(FinChrgMemoLine,TempExtTextLine,IsHandled);
 IF IsHandled THEN
   EXIT;
 // NEW END;
 ToFinChrgMemoLine.RESET;
 ToFinChrgMemoLine.SETRANGE("Finance Charge Memo No.",FinChrgMemoLine."Finance Charge Memo No.");

LOCAL PROCEDURE OnBeforeInsertFinChrgMemoExtText@5048253(VAR FinChrgMemoLine@5048252 : Record 303;VAR TempExtTextLine@5048251 : TEMPORARY Record 280;VAR IsHandled@5048253 : Boolean);


[External]
PROCEDURE InsertPurchExtTextRetLast@35(VAR PurchLine@1000 : Record 39;VAR LastInsertedPurchLine@1002 : Record 39);
 // NEW BEG
 OnBeforeInsertPurchExtText(PurchLine,TempExtTextLine,IsHandled);
 IF IsHandled THEN
   EXIT;
 // NEW END;
 ToPurchLine.RESET;
 ToPurchLine.SETRANGE("Document Type",PurchLine."Document Type");

LOCAL PROCEDURE OnBeforeInsertPurchExtText@5048254(VAR PurchLine@5048250 : Record 39;VAR TempExtTextLine@5048251 : TEMPORARY Record 280;VAR IsHandled@5048253 : Boolean);


[External]
PROCEDURE InsertServExtText@18(VAR ServiceLine@1000 : Record 5902);
 // NEW BEG
 OnBeforeInsertServExtText(ServiceLine,TempExtTextLine,IsHandled);
 IF IsHandled THEN
   EXIT;
 // NEW END
 ToServiceLine.RESET;
 ToServiceLine.SETRANGE("Document Type",ServiceLine."Document Type");

LOCAL PROCEDURE OnBeforeInsertServExtText@5048255(VAR ServiceLine@5048250 : Record 5902;VAR TempExtTextLine@5048251 : TEMPORARY Record 280;VAR IsHandled@5048253 : Boolean);

Furthermore, I think it would make sense if ReadLines is global and we could get access to TempExtTextLine from outside. I have created the following function for it.

PROCEDURE GetTempExtTextLine@5048252(VAR Value@5048250 : TEMPORARY Record 280);
  Value.COPY(TempExtTextLine,TRUE);

I have saved my code unit customized by the events as a .txt file in the attachment.

Thank you very much! COD378.txt

MattiLE avatar Jul 25 '19 14:07 MattiLE