Wong
Active Member
Dear all,
I'm working on the Inventory Adjustment program, when i perform inventory adjustment, the lot expiration date will be retrieve from Lot Master (F4108) by business function F4114 Edit Line.
Here is my problem, i able to overwrite the lot expired date at grid row exit events by taking system date + the shelf life days from Item Master.
When i click on button OK, i want to update this new lot expired date to Lot Master. So i put the customization code at Clear Screen After Add event (headerless detail form). But the update doesn't work properly. When i put a debug in fat client to test, the update is working fine. When i disable the debug function then the update doesn't work again.
Why & what causes the update not working properly? Why with debug & without debug will have 2 different result? Anyone can help me?
Here is my code:
M & D Debug Function
// ---------------------------------------------------------------------------
// Update F4108 item expiration date - by WongYK 19/07/13
// ---------------------------------------------------------------------------
F4111.Select
F4111.Fetch Next
While SV File_IO_Status is not equal to CO ERROR
F4101.Fetch Single
VA frm_Temp_ExpiredDate = add_days([SL DateToday],[VA frm_Temp_ShelfLifeDays])
F4108.Fetch Single
If SV File_IO_Status is equal to CO SUCCESS
F4108.Update
End If
VA frm_Temp_ExpiredDate = ""
VA frm_Temp_ItemNo = ""
VA frm_Temp_LotNo = ""
VA frm_Temp_ShelfLifeDays = ""
F4111.Fetch Next
End While
//
// ---------------------------------------------------------------------------
// Reset Variable
// ---------------------------------------------------------------------------
VA frm_Temp_MCU = ""
VA frm_Temp_ICU = ""
VA frm_Temp_DGL = ""
I'm working on the Inventory Adjustment program, when i perform inventory adjustment, the lot expiration date will be retrieve from Lot Master (F4108) by business function F4114 Edit Line.
Here is my problem, i able to overwrite the lot expired date at grid row exit events by taking system date + the shelf life days from Item Master.
When i click on button OK, i want to update this new lot expired date to Lot Master. So i put the customization code at Clear Screen After Add event (headerless detail form). But the update doesn't work properly. When i put a debug in fat client to test, the update is working fine. When i disable the debug function then the update doesn't work again.
Why & what causes the update not working properly? Why with debug & without debug will have 2 different result? Anyone can help me?
Here is my code:
M & D Debug Function
// ---------------------------------------------------------------------------
// Update F4108 item expiration date - by WongYK 19/07/13
// ---------------------------------------------------------------------------
F4111.Select
F4111.Fetch Next
While SV File_IO_Status is not equal to CO ERROR
F4101.Fetch Single
VA frm_Temp_ExpiredDate = add_days([SL DateToday],[VA frm_Temp_ShelfLifeDays])
F4108.Fetch Single
If SV File_IO_Status is equal to CO SUCCESS
F4108.Update
End If
VA frm_Temp_ExpiredDate = ""
VA frm_Temp_ItemNo = ""
VA frm_Temp_LotNo = ""
VA frm_Temp_ShelfLifeDays = ""
F4111.Fetch Next
End While
//
// ---------------------------------------------------------------------------
// Reset Variable
// ---------------------------------------------------------------------------
VA frm_Temp_MCU = ""
VA frm_Temp_ICU = ""
VA frm_Temp_DGL = ""