Getting more then one flied in a report

I have a report with these two tabels:

DataItem Name
Item Journal Batch
Item Journal Line

In the C/AL Editior I have:

Item Journal Line - OnAfterGetRecord()

//XCEL001.sn
CLEAR(Itemrec);
IF Itemrec.GET(“Item Journal Line”.“Item No.”) THEN
//XCEL001.en

With this thing i get the field Text from table Item, but i cannot get the field Item Manufacturer. What i am doing wrong?

Do I use someting like

Itemrec.Text
Itemrec.“Item Manufacturer”

In the C/AL editor, press F5. This opens the object browser. On the left side scroll down to the ItemRec variable, and then at the top of the list in the middle you should see FieldName, and on the right side the list of available fields for you to access.

I know which fields are in the table. I can also put them in the section. When i print this report the text is printed in the report, but the manufacturer is not printed, it stays blank.

I have put in the C/A Globals the following:

Name DataType Subtype Length
Itemrec Record Item

So you have the fields in text boxes in your section, and one fields has a value but the other field doesn’t? Are both fields in the same section? Did you verify that this Item you are looking at has a value in that field? I am assuming you are talking about the “Manufacturer Code” field in the Item table. This is a regular field so if it has a value, it should display. Make sure that the SourceExpr of your textbox is set to Itemrec.“Manufacturer Code”

I find one thing strange. SourceExpr of text = Itemrec.text and the item manufacturer = Itemrec.“Item Manufacturer” One has “” and the other not. I asume that the reason is that one is text field and the other a string or something like that. The Item tabel is not completly standard anymore (NAVW14.00.03 + vendor modify)

Can it be something that one thing has to be first?

When a field name has a space in it, the system automatically puts double quotes around the field name. A field’s data type has no effect on the double quotes.

Your “Item Manufacturer” field must be a custom field. If it is a flowfield, you will have to do a CALCFIELD right after you get the item.

I don’t know what you mean by that.

I think i am getting close to the solution

Okay, it can be a flowfield, but how do i know it is?

How do i make a CALCFIELD?

Can you please tell me how have to modify this line with a CALCFIELD:

//XCEL001.sn
CLEAR(Itemrec);
IF Itemrec.GET(“Item Journal Line”.“Item No.”) THEN
//XCEL001.en

If you don’t know anything about this, you should really not be working with it [:#]

You open the table in design mode and you look at the FieldClass property

IF Itemrec.GET(“Item Journal Line”.“Item No.”) THEN BEGIN
Itemrec.CALCFIELDS(“Item Manufacturer”);
END;

I do know

Maybe not, but if i dont try i will never work with it, but I have to work with it. The problem is that don t have a simple manual, how to connect tables with each other, get tables which arent there yet (like the one i am using now) for example. So i have to look at other reports and they arent always that clear.

When i am at work tomorrow i will try your solutions. When it works i will let you konw and then i will thank you for helping me.

Thnks for your help that was the answer.

One thing i couldnt do:

Red-Eagle:
Okay, it can be a flowfield, but how do i know it is?

You open the table in design mode and you look at the FieldClass property

The problem is that the vendor has given no rights to open this tabel in design mode. Can you find this informatiion at another way?

If you are on SQL Server, then the flowfield is not a field in the SQL Server table design, because they are calculated values. DO NOT modify anything in the table design on SQL Server.

By the way… your Vendor does not have a license to access table design? Are you talking about your NAV partner?

On native you’re going to have to verify that a field is a flowfield by looking at the table designer. You can purchase the table designer as a granule, it’s not something that you can simply get permission for, it must be part of your license.

Then you may:

a) Ask your vendor whether the field is a flowfield.

b) Add the line ItemRec.CALCFIELDS(“Item Manufacturer”) and try, if don’t get any error it’s a flowfield. [:)]

Hi

Use Calcfields Property to get (item manufacturer).