Joker85
October 17, 2013, 10:58am
1
Hello together,
I have a small problem with a form. I hope someone can help me?!
That’s what I do:
Open a Form like “Purchase Orders” and print the purchase.
The report modified the record and counts a value higher (“no. of prints”).
The record is modified, but at the form the old value is still displayed.
What can I do to refresh the form?
CurrForm.UPDATECONTROLS or CurrForm.UPDATE at the print button has brought nothing.
Any ideas?
Thanks!
Wel;come to DUG.
Which version are you using?
Is it standatd form or customized?
I tested in NAV2009R2 and Form is update with correctly once it is printed in standard database.
Joker85
October 17, 2013, 11:28am
3
Hi,
thanks for your fast response!
I’m using NAV2009R2.
Yes, but that was an example.
I want the same for our “Production Order”.
I have extended the table and add the fields to the form “Planned Production Order”.
After the print of the working papers, the counter in the form have still the old value.
What’s different to Purchase?
Where did you write code? Did you use Codeunit as in Purchase?
Joker85
October 17, 2013, 12:13pm
5
the selection of the report in a codeunit, the calling on the push button on the form and modify the record by the report.
Joker85
October 17, 2013, 12:13pm
6
the selection of the report in a codeunit, the calling over the push button on the form and modify the record by the report.
Did you check CU317 in standard database how Purchase is printed and counted?
Yes, i use the same code.
only for “production order”, but not in a new CU.
I placed the code directly in the report.
Did you try by moving it to Codeunit?
Joker85
October 17, 2013, 1:49pm
10
Yes, I’ve tried it.
I’ve called a funtion in a CU, but the result was the same.
Can you show us the code you written for all this requirement?
Joker85
October 17, 2013, 2:29pm
12
//“Production Order” - Form
- OnPush() //Print button
ManuPrintReport.PrintProductionOrder(Rec,0); //CU “Manu. Print Report”
//CU “Manu. Print Report”
Find the right report…
Call the report
//Report
First Data Item “Production Order”
Production Order - OnPostDataItem()
IF NOT CurrReport.PREVIEW THEN BEGIN
uARCEinr.GET;
IF UPPERCASE(USERID) <> uARCEinr.“Archiv User ID” THEN
BEGIN
FIND;
“No. Printed” := “No. Printed” + 1;
“Printed By” := UPPERCASE(USERID);
“Date Printed” := CURRENTDATETIME;
MODIFY;
COMMIT;
END;
END;
Did you check whether the code under IF UPPERCASE(USERID) <> uARCEinr.“Archiv User ID” THEN is executing?
simply add any message and try.
Is your report printing right production order?
Joker85
October 18, 2013, 11:35am
14
Yes, the report is printing right. After this, the record is modified.
When I switch the focus, the form update right. The new values are displayed.
admin1
October 21, 2013, 7:29am
15
So Andreas does this mean you have solved your problem?
Joker85
October 21, 2013, 8:41am
16
Hello Erik,
not really!
But the problem is solved, because I call in this Action 2 reports on.
The focus change and my form updates itself by itself.
The original problem remains unsolved.
admin1
October 21, 2013, 8:51am
17
Hi Andreas,
After this line in the code:
Try to insert: CurrForm.UPDATE;
Joker85
October 21, 2013, 9:19am
18
Hi Erik,
I have already tried. It’s the wrong time.
The report request form is open but the request is not printed.
In the same time the line “CurrFor.UPDATE” run.
The problem is, that in this moment the record is not changed yet.
The update-command must happen later.
admin1
October 21, 2013, 9:30am
19
What do you exactly mean? If the report request form is still open, then it means that report has not yet been printed and your CurrForm.UPDATE has not been run yet.
May I suggest that you enables the debugger and check exactly which code lines are being executed when?