Hello
I am new to BC and I have to create a Report extension (Copy fixed asset) and add a company lookup to the Report Request Page to use the Selection for the copy later
How can I do this?
Best regards
Chris
Yes I will. It is just playing around. writing a new report and do such stuff seems to be easy (more or less) but extending one and do the coding to change the functionality of the existing one is not that clear to me
Hi
Yes as I told in the first message I am new to BC. Thx. a lot. the lookup works.
Now I have to find out how I can extend the rest to copy the FA from the selected company to the current one.
Try with this. Looks like you are new to BC coding and need to learn where to place the code/variable declaration etc.
reportextension 62005 "CopyFixedAssetCFAC" extends "Copy Fixed Asset" //5685
{
dataset
{
}
requestpage
{
layout
{
addbefore(FANo)
{
/*
field(CompName; CompName)
{
Caption = 'Company Name';
ApplicationArea = FixedAssets;
TableRelation = "Company Information";
}
trigger OnLookup(var Text: Text): Boolean
var
CompanyRec: Record "Company Information";
begin
CompanyRec.Reset();
if Page.RunModal(Page::"Company Information", CompanyRec) = Action::LookupOK then
CName := CompanyRec.Name;
end;
*/
field(CompName; CompName)
{
Caption = 'Company Name';
ApplicationArea = FixedAssets;
TableRelation = Company;
}
}
}
}
var
CompName: Code[100];
}
Here the code (but I played around allready:
Please share your complete code here
Could you please share the code and error?
Nothing seems to work. All options mentioned here are ending in errors....(different kind of)
This code should be enough
field(CompName; CompName)
{
Caption = 'Company Name';
ApplicationArea = FixedAssets;
TableRelation = Company;
}
var
CompName: Code[30];
CompanyName is system defined function so we should not use that.
Declare a variable with name CompName etc. and use it instead of CompanyName.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156