Page 1 of 1

Explore Yunus and FW_dbftoarray and FW_SaveArrayToDBF

PostPosted: Wed Aug 30, 2023 9:51 am
by Marc Venken
I was exploring Yunus and how to retrieve invoice items, update en save.

These function are used, but i'm not that sure yet.

These functions are based on a recno() that is added and depending on the delete status of a invoice item.
Deleted items are NOT taken by the function and so only GOOD items will come into the invoice. When adding and changing data, the save function will write back
and change the values.

Is it save to think that this process is 100% fullprove ? Will the recno's not change when deleting of adding items to the invoice that will be saved ?

Do I have to delete the items so now and then in a separate maintenance procedure where all deleted invoice items will be erased for sure ?

Before save this code is done in Yunus.

if ! Empty( oBrw:aDeleted )
AEval( oBrw:aDeleted, { |a| a[ 9 ] := -a[ 9 ] } )
IIT->( FW_SaveArrayToDBF( cItemFlds, oBrw:aDeleted ) )
endif

What is the AEval doing ?

Re: Explore Yunus and FW_dbftoarray and FW_SaveArrayToDBF

PostPosted: Wed Aug 30, 2023 10:04 am
by nageswaragunupudi
Is it save to think that this process is 100% fullprove ?


Yes. Safe and 100% full-proof.
You need to carefully study the functions used carefully to appreciate the logic.

Will the recno's not change when deleting of adding items to the invoice that will be saved ?

This is the basic behavior of DBFs.
When records are deleted, recno()s do not change. Only deleted flag will be set for the records.
The RecNo()s will change only when the DBF is "PACKED".