I'm using Business central V15 wave 2 release. yes resource list is customized.
Please look into my code below.
page 50199 "Team Resource List"
{
AdditionalSearchTerms = 'capacity,job,project';
ApplicationArea = Jobs;
Caption = 'Exigent Resources';
CardPageID = "Resource Card";
Editable = false;
PageType = List;
PromotedActionCategories = 'New,Process,Report,Resource,Navigate';
SourceTable = "Team Resource";
UsageCategory = Lists;
layout
{
area(content)
{
repeater(Control1)
{
ShowCaption = false;
field("No."; "No.")
{
ApplicationArea = Jobs;
ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
// TableRelation = Resource."No.";
// DrillDownPageId = "Resource Card";
trigger OnDrillDown()
var
ResoTbl: Record Resource;
ResPage: page "Resource Card";
EmpTbl: Record Employee;
begin
//Message('Test 001');
EmpTbl.SetFilter("AD user name", UserId);
if EmpTbl.FindFirst() then begin
ResoTbl.SetFilter("No.", EmpTbl."Resource No.");
if ResoTbl.FindFirst() then begin
ResPage.SetTableView(ResoTbl);
ResPage.SetRecord(ResoTbl);
ResPage.Run();
end;
end;
// Message('Test 002');
end;
}
field(Name; Name)
{
ApplicationArea = Jobs;
ToolTip = 'Specifies a description of the resource.';
}
field(Type; Type)
{
ApplicationArea = Jobs;
ToolTip = 'Specifies whether the resource is a person or a machine.';
}
field("Base Unit of Measure"; "Base Unit Of Measures")
{
ApplicationArea = Jobs;
ToolTip = 'Specifies the base unit used to measure the resource, such as hour, piece, or kilometer.';
}
field("Employee No."; "Employee No.")
{
Caption = 'Employee No.';
ApplicationArea = all;
}
field(Location; Location)
{
Caption = 'Location';
ApplicationArea = all;
}
field(Department; Department)
{
Caption = 'Department';
ApplicationArea = all;
}
field("Job Title"; "Job Title")
{
Caption = 'Job Title';
ApplicationArea = all;
}
field("Compnay Phone No."; "Compnay Phone No.")
{
Caption = 'Compnay Phone No.';
ApplicationArea = all;
}
field(Extension; Extension)
{
Caption = 'Extension';
ApplicationArea = all;
}
}
}
}
actions
{
}
trigger OnAfterGetCurrRecord()
var
CRMCouplingManagement: Codeunit "CRM Coupling Management";
begin
CRMIsCoupledToRecord := CRMIntegrationEnabled;
if CRMIsCoupledToRecord then
CRMIsCoupledToRecord := CRMCouplingManagement.IsRecordCoupledToCRM(RecordId);
end;
trigger OnOpenPage()
var
CRMIntegrationManagement: Codeunit "CRM Integration Management";
EmpTbl: Record Employee;
ResTbl: Record Resource;
TeamRes: Record "Team Resource";
begin
CRMIntegrationEnabled := CRMIntegrationManagement.IsCRMIntegrationEnabled;
if TeamRes.FindSet() then begin
repeat
TeamRes.Delete();
until TeamRes.Next() = 0;
end;
EmpTbl.SetFilter("AD user name", UserId);
if EmpTbl.FindFirst() then begin
ResTbl.SetFilter("No.", EmpTbl."Resource No.");
if ResTbl.FindFirst() then begin
"No." := ResTbl."No.";
Name := ResTbl.Name;
Type := ResTbl.Type;
"Job Title" := ResTbl."Job Title";
"Base Unit Of Measures" := ResTbl."Base Unit of Measure";
Department := ResTbl.Department;
"Employee No." := ResTbl."Employee No.";
"Employment Type" := ResTbl."Employment Type";
Extension := ResTbl.Location;
Location := ResTbl.Location;
"Compnay Phone No." := ResTbl."Compnay Phone No.";
Insert();
Commit();
end;
end;
end;
var
CRMIntegrationEnabled: Boolean;
CRMIsCoupledToRecord: Boolean;
procedure GetSelectionFilter(): Text
var
Resource: Record Resource;
SelectionFilterManagement: Codeunit SelectionFilterManagement;
begin
CurrPage.SetSelectionFilter(Resource);
exit(SelectionFilterManagement.GetSelectionFilterForResource(Resource));
end;
procedure SetSelection(var Resource: Record Resource)
begin
CurrPage.SetSelectionFilter(Resource);
end;
}
Regards,
Harshit