Show field from another table

In a report I want to show the department name in Service Shipment Header section.

I have “Service Shipment Header”.“Shortcut Dimension 1 Code” and now I need the Name.

As usualy I created a new global variable named DimValue - Recor Dimension Value and created this C/AL on:

Service Shipment Header - OnAfterGetRecord()

CLEAR(DimValue);
IF (“Service Shipment Header”.“Shortcut Dimension 1 Code”) <> ‘’ THEN
IF DimValue.GET(“Service Shipment Header”.“Shortcut Dimension 1 Code”) THEN;

But this time the name does not appear on report, I don’t know why???

thanks

What is the source expression of text box, supposed to display this NAME?

Hy

The source expression of text box is DimValue.Name

Thanks

The Primary Key of Dimension Value table is Dimension Code,Code, which means while using GET statement for DimValue you should specify two parameters:

  1. Shortcut Dimension 1 Code (Area, Project or whatever is your SD 1), you may get it From G/L Setup

  2. Value of GD1, in this case

So

GLSetup.GET;

CLEAR(DimValue);
IF (“Service Shipment Header”.“Shortcut Dimension 1 Code”) <> ‘’ THEN
IF DimValue.GET(GLSetup.“Shortcut Dimension 1 Code”,“Service Shipment Header”.“Shortcut Dimension 1 Code”) THEN;

PS (Edit): Define GLSetup as Global Variable , Record, 98

Sorry , but GLSetup does not have the name Dimension code, so I must get Name field from Dimension Value.

But I don’t know how???

Did you even try the suggested solution?

I have suggested changes in code, you need to just copy & paste it, don’t change the sourceexpression of your text box.

Try this and come back if you face any problem

Dhan

You are right.

I implemented your solution but changing my source expression, that was the problem.

Every thing is ok now.

Thanks