Hi All
I am new to AL programming and requires some help in the follwing query , i need to get the unti price from Resouce table and assinge to Varibable for Further calculation and dispalyin on the Assembly line sub form.
its erroring in the part
SELECT "Unit_Price"
FROM "Resource"
WHERE "Resource ID" = varResourceID
INTO varUnitPrice;
Here is the full code
pageextension 50003 PageExtension50003 extends "Assembly Order Subform"
{
layout
{
addafter("Unit Cost")
{
field("ZY Resource Unit Price"; Rec.ZY_ResourceUnitPrice)
{
ApplicationArea = All;
}
field("ZY Resource Margin92783"; Rec.ZY_ResourceMargin)
{
ApplicationArea = All;
}
field("ZY Total Price"; Rec.ZY_TotalPrice)
{
ApplicationArea = All;
}
}
}
var
varResourceID : Code[20] ;
varUnitPrice: Decimal;
varQuantity : Decimal;
UpriceTot : Decimal;
trigger OnNewRecord(BelowxRec: Boolean)
begin
varResourceID := Rec."No.";
varUnitPrice := 0;
varQuantity := Rec.Quantity;
UpriceTot := 0;
SELECT "Unit_Price"
FROM "Resource"
WHERE "Resource ID" = varResourceID
INTO varUnitPrice;
UpriceTot := varUnitPrice * varQuantity;
Rec.ZY_ResourceUnitPrice := varUnitPrice;
Rec.ZY_TotalPrice := UpriceTot;
end;
}
Appriciate your experties and time and Tahks in Advanced.