• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Calling F4311 Edit Line multiple times in a loop

johndanter

Legendary Poster
Hi folks,

Can someone help me with something I maybe doing wrong in the code below please?

Basically I save records off to a workfile, F554111P. then I read through that work file and write a PO line for however many I encounter.

What's happening is the first line is working fine but then that's it. 2 3 4 etc don't work and there is no clear error in the log. So I am at a loss.

I am incrementing the LNID. So I've no idea

Code is attached as it's too big to paste

Thanks

John
 

Attachments

craig_welton

Legendary Poster
Hi John,

The debug log should provide some insight into this, but you may want to try not passing the line number to edit line. I checked a similar process we do and we are letting it assign the number. Just a stab. Post the debug, if you want.

Craig
 

johndanter

Legendary Poster
Hi Craig,

Thanks for this. That's odd if that works :) I'll try Monday.

But how does the cache know it needs to update/create a new PO line if you don't feed in the LNID?

I'm having trouble uploading the log, sorry.
 

johndanter

Legendary Poster
I commented out the LNID and it's created the first line at 1.000 but not created anymore.

I'll check the logs now and I can see I am having errors when checking F43090. So I am hoping it was that all along :)
 
Last edited:

DSauve

Legendary Poster
Have you verified if the variable cWrittenToWorkFile_EV01 is being set to 1 for calls after line 1.000? It looks like you are relying on this being set from the call to F4311EditLine. It might be worth a look to verify that this is working as expected.
 

johndanter

Legendary Poster
I did thanks.

It's a variable fed both ways. First call its 0 and then the value passed back is used on lines 2 & 3 etc

I think it's this F43090 issue as the line that did work didn't have this error and the F4311EditLine log for that call is far greater
 
Last edited:

johndanter

Legendary Poster
Hi again,

If anyone has any code of them using F4311 Edit Line in a loop, can they kindly please post it up here?

I've fixed what I thought was the Supplier Item setup issues but I still get the same error. It maybe something else when I start debugging. but that won't be for a few days.

So I'm hoping someone else has done this and I can check the code against mine.

Thanks

John
 

johndanter

Legendary Poster
I've got this to work now.
All I've done is add TRDJ and Promised date etc. I added data into F4311Z1 etc and ran r4311Z1I with logging on.
Looked at what it feeds in and copied it.

Works like a charm
 
Top