R42565 customization with changes on F42565 Help on Table IO

clmates

Reputable Poster
Hi to all.

We have made a customization to R42565 that changes the payment terms based on total invoice amount.

We used a custom table to store the customer AN8, the amount lower limit and the new payment terms to apply.

In order to change this at invoice runtime, we created a business function in NER that we call in the Phase 1 Build File End Section, Just at the begin of the section (before the Detail Line 1 Section is Called)

The business function loops on F42565 (using handles), and calculates the invoice total amount, then on invoice change, checks the customer for payment term rules (on the custom table), and updates the F42565 PTC and F4211 PTC accordingly.

the problem we had notice is that sometimes the Detail Line 1 Section is running before the F42565 table is totally updated, we also run the update using a handle.



here are the questions:

1. This could be solved using a transaction?
2. Could we include in the transaction only the call and updates of this NER?
3. Could this problem be related to use the flag "Check for Record Change" on the updates to F42565 and F4211, could this impact performance?

We had other similar customization for adding a line to F4211 amd F42565 for freight charges and is running fine, the only difference is that this one uses inserts and the one failing uses updates.

Many Thanks
 
Hi.

to be more precise these are my ER

0131 VA evt_Handle2F42565_HF42565 = F42565.Open Handle
0132 F42565(VA evt_Handle2F42565_HF42565).Select
BF Maquina_CTID = TK Computer ID
BF Trabajo_JOBS = TK Job Number
VA evt_NumeroFacturaAnt_DOC = TK Document (Voucher, Invoice, etc.)
VA evt_TipoFacturaAnt_DCT = TK Document Type
VA evt_CompaniaFacturaAnt_KCO = TK Document Company
0133 F42565(VA evt_Handle2F42565_HF42565).Fetch Next
VA evt_NumeroPedido_DOCO <- TK Document (Order No, Invoice, etc.)
VA evt_TipoPedido_DCTO <- TK Order Type
VA evt_CompaniaPedido_KCOO <- TK Order Company (Order Number)
VA evt_LineaPedido_LNID <- TK Line Number
VA evt_Secuencia_OSEQ <- TK Sequence Number
0134 While SV File_IO_Status is equal to CO SUCCESS
0135 F42565.Update
BF Maquina_CTID = TK Computer ID
BF Trabajo_JOBS = TK Job Number
VA evt_NumeroFacturaAnt_DOC = TK Document (Voucher, Invoice, etc.)
VA evt_TipoFacturaAnt_DCT = TK Document Type
VA evt_CompaniaFacturaAnt_KCO = TK Document Company
VA evt_NumeroPedido_DOCO = TK Document (Order No, Invoice, etc.)
VA evt_TipoPedido_DCTO = TK Order Type
VA evt_CompaniaPedido_KCOO = TK Order Company (Order Number)
VA evt_LineaPedido_LNID = TK Line Number
VA evt_Secuencia_OSEQ = TK Sequence Number
VA evt_TerminoPagoAsignar_PTC -> TK Payment Terms Code
0136 F4211.Update
VA evt_CompaniaPedido_KCOO = TK Order Company (Order Number)
VA evt_NumeroPedido_DOCO = TK Document (Order No, Invoice, etc.)
VA evt_TipoPedido_DCTO = TK Order Type
VA evt_LineaPedido_LNID = TK Line Number
VA evt_TerminoPagoAsignar_PTC -> TK Payment Terms Code
VA evt_User_USER -> TK User ID
VA evt_Programa_PID -> TK Program ID
VA evt_Equipo_JOBN -> TK Work Station ID
VA evt_Fecha_UPMJ -> TK Date - Updated
VA evt_Hora_TDAY -> TK Time of Day
0137 F42565(VA evt_Handle2F42565_HF42565).Fetch Next
VA evt_NumeroPedido_DOCO <- TK Document (Order No, Invoice, etc.)
VA evt_TipoPedido_DCTO <- TK Order Type
VA evt_CompaniaPedido_KCOO <- TK Order Company (Order Number)
VA evt_LineaPedido_LNID <- TK Line Number
0138 End While
0139 F42565(VA evt_Handle2F42565_HF42565).Close


The updates had the Check for record Change flag activated.

I'm going to test without this, as for F42565 I am sure it will not change.

also I want to know how is best to do the update of the F42565:

a. as above, with a simple update

b. using the same handle that the one in the select

c. using a new handle

Thanks
 
Back
Top