don't know hot to delete loop record

maya-chan
Member Posts: 45
Hi Masters,
I confuse of my problem. Here, a task from user. They need report for transfer shipment. But usually when enter/input for this table they didn't use item no but user search description (by using search description they could get the item no/part no). The problem is, there is 1 record that have multiply input but only have 1 item no/part no (others are comment only), but on report shown 4 part no which is the part no of 1st then loop to 2nd and 3rd line. How I delete or make it not loop for 2nd and 3rd line?
I hope all of you can understand what I mean.
Please and thanks
I confuse of my problem. Here, a task from user. They need report for transfer shipment. But usually when enter/input for this table they didn't use item no but user search description (by using search description they could get the item no/part no). The problem is, there is 1 record that have multiply input but only have 1 item no/part no (others are comment only), but on report shown 4 part no which is the part no of 1st then loop to 2nd and 3rd line. How I delete or make it not loop for 2nd and 3rd line?
I hope all of you can understand what I mean.
Please and thanks
0
Comments
-
If it is donr through code then you can find
IF xxx.FINDSET THEN REPEAT UNTIL xxx.NEXT = 0;
If you need only first record then useIF xxx.FINDFIRST THEN
0 -
Thanks for your replying.
I will try it. I have to modified last report from other consultant, i try if it is could or not (that's the prob)0 -
The correct solution is to teach your users how to search and filter correctly. You should never think of CODE as a substitute for training. Once you start down this path they will want everything modified to their way of working instead of learning Navision.
I bet this conversation starte with the users saying "Yeah but in our old system..." That is called the road to hell.David Singleton0 -
Mr David,
Yeah you are correct. But, we can't avoid user habit. From the beginning they always search description rather than input part no or item no. Then use other comment on the next line. When I see table Transfer Shipment Line, that I found and realize why it loop. But until now can't solve. 1st Consultant who fix it before has resigned and now i confuse about his code.
onaftergetrecord()
PostedDocDim2.SETRANGE("Table ID",DATABASE::"Transfer Shipment Line");
PostedDocDim2.SETRANGE("Document No.","Transfer Shipment Line"."Document No.");
PostedDocDim2.SETRANGE("Line No.","Transfer Shipment Line"."Line No.");
//this part I guess for looping
vUnitPrice := 0;
vTotalAmt := 0;
IF vItem.GET("Transfer Shipment Line"."Item No.") THEN BEGIN
vUnitPrice := vItem."Unit Price";
vPartNo := vItem."Search Description";
// even user input just a comment and no part no, on the report still shown looping and take the 1st part no and on the description there's //show the comment
END;
vTotalAmt := vUnitPrice * "Transfer Shipment Line".Quantity;0 -
I tried Mohanna code, but I can't change anything on this. When I compile, always shown error
Error while validating RDL content:
The value expression for textbox 'Transfer_Shipment_Line_Item_No_Caption' refers to field 'Transfer_Shipment_Line_Item_No_Caption'. Report item expression can only refer to field with in the current data set scoop on, if inside an aggregate, the specified data set scoop.
anyone know what the error mean?0 -
maya-chan wrote:I tried Mohanna code, but I can't change anything on this. When I compile, always shown error
Error while validating RDL content:
The value expression for textbox 'Transfer_Shipment_Line_Item_No_Caption' refers to field 'Transfer_Shipment_Line_Item_No_Caption'. Report item expression can only refer to field with in the current data set scoop on, if inside an aggregate, the specified data set scoop.
anyone know what the error mean?
Did you delete any field in classic sections and forget to delete in rdlc data (related to RTC report)?
Error message is completely different..not related to code which I suggested..0 -
Did you delete any field in classic sections and forget to delete in rdlc data (related to RTC report)?
Error message is completely different..not related to code which I suggested..[/quote]
No. I didn't do anything with the table (deleted field or anything). Only with report. I see that code and wanna modify, but can't even just put enter. When compile shown that error.0 -
Oke, just assume the person who 1st modify this report do deleted field. So, where should I must go to check weather it has been delete or not on RDLC data?0
-
maya-chan wrote:No. I didn't do anything with the table (deleted field or anything). Only with report. I see that code and wanna modify, but can't even just put enter. When compile shown that error.
I mean in sections of report..
If you didnt then the problem should be exising before also..0 -
I am not sure about it. It could be, because I get it from other consultant before. If we have deleted like u said, what should I do then?0
-
You have to identify the field and add it in classic sections of report or delete the field in rdlc report..0
-
Oke I try.
Thanks0 -
I have restore the database with the last object before modify that report.
It's same, I can't modify with same error. But I can run it same like before the looping show.
I don't know how to go to RDLC report and delete what mention on the error message. Can you explain the step for me?
Sorry if it is bother you
Thanks0 -
maya-chan wrote:Mr David,
Yeah you are correct. But, we can't avoid user habit.
Yes you can, its called training.
It's their job that they are paid to do.David Singleton0 -
Hmm ok, it could be my homework to them. They want create some comments on this report that's why.
But now I still stuck with can't modify the code report.
Please anyone can help....0 -
the error you got is because the rdlc layout (the report design for the RTC client) should display a control that has been deleted on the classic layout (section designer).
according to the error message a control with the property DataSetFieldName set to "Transfer_Shipment_Line_Item_No_Caption" is missing. Because NAV generates these DataSetFieldNames based on the DataItem Name, field caption and the fact if its a title or not. I can tell that probably the Title of the "Item No."-column has been deleted.
If your customer doesn't use RTC i'd think about deleting the rdlc layout because you won't be able to delete any control on the classic section designer anymore if you don't adjust the rdlc layout every time. Even though it would be absolutely unnecessary if noone is using RTC on that database anyway. I must warn you though that it is a lot of work to recreate it the way it looked before. And i won't take any responsibility. So better make a backup ;-)
There are two other ways to fix the problem:
a) re-insert the control for the "Item No."-title back into the classic design and set its DataSetFieldName property to "Transfer_Shipment_Line_Item_No_Caption" (it's the last property in the property window).
b) go into the rdlc layout designer. Find the field that is supposed to print this title and delete the value of that field. (or adjust the layout so you can delete the whole field).
Back to your opening question: it opens up the question if you are concerned about the rtc layout or the classic layout. on the rtc, there could be just an issue with some properties... on the classic: i'd work with the CurrReport.SHOWOUTPUT(Boolean) command. A Report that is made for printing purposes should never edit the data its Processing in my opinion.
but just for a guess: try this code here instead of skipping or editing (this should allow you to keep the comment lines printed ;-) (i colored the line i edited from your code to red)
onaftergetrecord()
PostedDocDim2.SETRANGE("Table ID",DATABASE::"Transfer Shipment Line");
PostedDocDim2.SETRANGE("Document No.","Transfer Shipment Line"."Document No.");
PostedDocDim2.SETRANGE("Line No.","Transfer Shipment Line"."Line No.");
//this part I guess for looping
vUnitPrice := 0;
vTotalAmt := 0;
vPartNo := '';
IF vItem.GET("Transfer Shipment Line"."Item No.") THEN BEGIN
vUnitPrice := vItem."Unit Price";
vPartNo := vItem."Search Description";
// even user input just a comment and no part no, on the report still shown looping and take the 1st part no and on the description there's //show the comment
END;
vTotalAmt := vUnitPrice * "Transfer Shipment Line".Quantity;0 -
Dear Masters,
It's really help me. I will try this. 1st sure with the rdl data that missing. I hope I can find out it fast.
Once again, thanks guys0 -
I have re-inserted the control and set DataSetFieldName into Transfer_Shipment_Line_Item_No_Caption. But still same error. Did I do something wrong with the control?0
-
Oke, it's solved for the RDL prob
Trying next step.0 -
OK,
The Part No show blank but for unit Price & Total Amount still show 0. How do I convert decimal to string? I try format, but it doesn't work0 -
I got advice to split the report being 2 section.
1 with full data, and the other only descriptions. But I don't know hoe to do it.
I am newbie (sorry). Could anyone help me step by step, please???0 -
Problem solved with split section and coding from mohana.
Thx all0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions