Help with F0411FSEditDoc BSFN - 078P Update to cache F04UI002 failed

dlwiii3

Member
We are trying to use the F0411FS family of methods to create vouchers (BeginDoc, EditLine, EditDoc, EndLine).

We have successfully used the F0911FS family with no issues as well as the AcctRecFS family just fine.
But we are hitting and issue with the call to F0411FSEditLine. This keeps failing on cache update with the message " 078P Update to cache F04UI002 failed"

I looked in the C code and see just a few places this can happen, but do not know what is causing the update failure. What is the best way to see why this is failing?

I am pretty sure we have the header record in the cache just fine and that the one line is in there as well. it's just not clear why the update fails.

I'm thinking perhaps the values I am setting on the line are violating some database constraint.

Here is what debug logging shows- we have a cache with 0 records in it and then we try to update it. Could this be it?
Incremented cache count to 3
Created new cache - hCache:[08D7C7D8]
hCache:[08D7C7D8] Nm:[1F04UI002] Recs:0 Curs:0 Hnds:1 Cchs:3 INIT new
Entering jdeCacheUpdate - hCursor:[00000000]

If anyone had suggestions about this I surely would appreciate it!

Cheers
Daniel
 
Last edited:
You should take a look at the allocation of the pointer for the cache. You might not have enough memory, and you should inspect the codebase to ensure that jdeFree is used after all your cache processing.
 
You should take a look at the allocation of the pointer for the cache. You might not have enough memory, and you should inspect the codebase to ensure that jdeFree is used after all your cache processing.

jdeFree is not directly used with any of the JDECACHE APIs.
 
Agreed it is not used directly within the JDECACHE APIs. Memory has to be allocated and freed. I always play it safe with the jdeCacheTerminate or jdeCacheTerminateAll, as the cache is destroyed from memory only when the number of jdeCacheTerminate calls matches the number of jdeCacheInit or jdeCacheInitEx calls. I've made this mistake once and it haunts my every waking hour. None the less, sounds like a memory issue. Posting the code is really the best way to see what's happening.
 
The cache error is probably a side effect of some other bug - most likely in how you are calling the MBF. Looking at the log you posted the jdeCacheUpdate call is probably failing because there is not an open cursor (hCursor:[00000000]). There is probably not an open cursor because the cache instance probably doesn't contain any records. You say you are pretty sure that you have a header cache record but if the log you posted is indeed for the header cache then it doesn't look like that is populated.

When I have to call an MBF (or any other series of "related" BSFN calls) I usually use the pristine APPL that calls them and look at the JDE Debug log to reverse engineer what calls to make and what to pass. I use a good text editor with "column" edit capabilities so I can line up the values passed in/out of the BSFNs from the pristine APPL and the custom code - you can quickly spot any differences this way and start to narrow down what the problem might be. You may have all ready done this, if so you might be left with trying to debug the MBF to figure out what the problem is.
 
I found the issue - we were not populating the szProgramId value. Completely overlooked this!
 
BOster - yep, this is exactly how I tracked down the issue. Just looked at how EditLine was being called by other standard methods and saw I was missing szProgramId
 
Back
Top