filter problem

hi Frnds,

i want use fields of Record “Record Link” in my reports but i am unable to link with Sales line record. Please can anyone help me.

You must set the filter manually in the “OnPreDataItem” of the Record Link DataItem like the following code:
RecRef is a local variable of the type RecordRef.

RecRef.GETTABLE("Sales Line");
SETRANGE("Record ID", RecRef.RECORDID);

Sir,

What filter should i set in Dataitemlink property of Record link Dataitem.

You cant achive just by setting Dataitemlink property

you need to write code as suggested

Dear,

i have written this code but still my problem is same.

we need set some dataitemlink property also…if its parent dataitem is sales line or sales header.

We can set Links to sales header only in standard NAV (2009R2)

So you have to use Sales header as dataiem and write below code in Record Link Dataitem OnPredataitem trigger

RecRef.GETTABLE(“Sales Header”);
SETRANGE(“Record ID”, RecRef.RECORDID);

Dear, by same method can we achieve this in nav 2013 also…??

In that case take recordlink as global dataitem and use it in Sales Header - OnAfterGetRecord()

RecRef.GETTABLE(“Sales Header”);
RecLink.SETCURRENTKEY(“Record ID”);
RecLink.SETRANGE(“Record ID”, RecRef.RECORDID);
IF RecLink.FINDSET THEN
REPEAT
MESSAGE(’%1’,RecLink.“Link ID”);
UNTIL RecLink.NEXT=0

Thanks dear…it worked… but when I am using this code

RecRef.GETTABLE(“Sales Header”);
RecLink.SETCURRENTKEY(“Record ID”);
RecLink.SETRANGE(“Record ID”, RecRef.RECORDID);
IF RecLink.FINDSET THEN
REPEAT
Link_desc:=RecLink.Description;
Link_create:=RecLink.Created;
Link_user:=RecLink.“User ID”;

// MESSAGE(’%1’,RecLink.“Link ID”);
UNTIL RecLink.NEXT=0;

then it is showing me only first record id data in report but there are more data in that link.

Dear, I am unable to fetch all the data related to particular order from Record link.

If I keep these line in

Link_desc:=RecLink.Description;
Link_create:=RecLink.Created;
Link_user:=RecLink.“User ID”;

Repeat part then it only shows the first row and when I keep out of repeat then it shows only last row related to particular order.

Please help me and I have also tried by using array but not succeed.

You do not look your record link records in the REPEAT - UNTIL but you use the OnAfterGetRecord trigger.

The example from Mohana is just to demonstrate that the records are all fetched.

Just move your code “Link_Desc := …” to the OnAfterGetRecord trigger and then it works.