All,
I recently recompiled all of my VDF 16 apps to VDF 19 and all seemed fine. One of the users showed me a view in the Billing Program that no longer works correctly. It's a Cash Payment (header/detail) view I wrote over 20 years ago which creates Payment Line Items from the Customer's Open Invoice File, then refreshes the screen with the newly created payment line items for applying the correct amount to each invoice. Now, it still creates the line items, but the dbGrid doesn't populate with the Payment Line items created. Instead, it pops up an Invoice SL, since Cst_PDet.Inv# is Related to Invoice.Inv#.
Of course, since I really don't program anymore, with the exception of an occasional report, I'm totally lost how to troubleshoot this.
Code:
// In My Payment Header
Function Save_Header Returns Integer
Integer Rec Changed Srvr
Get Server To Srvr // The Header DDO.
Get Current_Record Of Srvr To Rec // The current order rec#.
Get Should_Save To Changed // Are there any current changes?
// If there is no record and no changes we have an error.
If (Rec=0 And Changed=0) Begin // no rec
Send Stop_Box "You Must First Create & Save the Payment Record." "Error:"
Function_Return 1
End
// Attempt to Save the current Record
// request_save_no_clear does a save without clearing.
Send request_save_no_clear
String sCst# sInv# sRef# sPlant# //sUser
number nAmt nBal
date dDate
Sysdate4 dDate
///// Get values from Cst_Pay to create records & do searches
Send refind_records to (Server(Self))
Get Value of oCst_mast_Code item 0 to sCst#
Get Value of oCst_pay_Ref# item 0 to sRef#
///// Search open invoice file for matching Cst_Mast.Code
//// If (found) create Cst_PDet record for each.
Clear Inv_Open
Move sCst# to Inv_Open.Cst_code
Repeat
Find gt Inv_Open by index.2
If (Inv_Open.Cst_code <> sCst#) Indicate Finderr True
[Finderr] Break
If (Inv_Open.Balance <> 0) begin
Move Inv_Open.Number to sInv#
Move Inv_Open.Plant to sPlant#
Clear Cst_PDet
Move sCst# to Cst_PDet.Cst_code
Move sRef# to Cst_Pdet.Ref#
Move sInv# to Cst_Pdet.Inv#
Find eq Cst_PDet by index.1
If (not(found)) begin
Move sPlant# to Cst_PDet.Plant
Move dDate To Cst_PDet.Created_Date
Move (psUser(oApplication(Self))) To Cst_PDet.Created_By
Saverecord Cst_Pdet
End
End
Loop
Send Rebuild_Constraints to (Cst_PDet_DD(Self))
// The save succeeded if there are now no changes, and we
// have a saved record. Should_save tells us if we've got changes.
// We must check the data-sets current_record property to see if
// we have a record. If it is 0, we had no save.
Get Should_Save To Changed // is a save still needed
Get Current_record Of Srvr To Rec // current record of the DD
// if no record or changes still exist, return an error code of 1
If (Rec=0 Or Changed) Function_Return 1
End_Function
Code:
// In my dbGrid
Function Child_entering Returns Integer
Integer rval
// Check with header to see if it is saved.
Delegate Get Save_Header to rval
Send Rebuild_Constraints to (Cst_PDet_DD(Self))
Send Beginning_of_Data of Cst_PDet_Grid
Function_Return rval // if non-zero do not enter
End_Function
Procedure Activating
Forward Send Activating
If (Server(Self) = (Main_DD(Self))) Procedure_Return
Integer iIndex
Get Ordering To iIndex
Set Ordering Of (Server(Self)) To iIndex
Send Beginning_of_Data of Cst_PDet_Grid
End_Procedure
Does anyone have any idea what might have changed between 16.0 and 19.0 to break code that's worked since at least ver. 7.0?
Thanks,
Leslie Stewart