I want to get the salesline by using the RecordRef, I am trying in this way, Creating a action in Sales Orders page through the action I will call the salesline but I am not getting the sales line, can anyone help me, My code is
action(Action11)
{
Caption = 'Action 10';
ApplicationArea = All;
ToolTip = 'Describes the msg of salesline';
Image = Action;
trigger OnAction()
var
RecRef: RecordRef;
FielRef: FieldRef;
begin
SalesLine.SetRange("Document Type", Rec."Document Type"::Order);
SalesLine.SetRange("Document No.", Rec."No.");
SalesLine.SetRange(Type, SalesLine.Type::Item);
recref.Open(37);
FielRef := RecRef.Field(SalesLine."Document Type");
FielRef.SetRange(SalesLine."Document Type", Rec."Document Type"::Order);
if RecRef.FindFirst() then
Message(Text000Msg, SalesLine."Document Type");
end;