Hi all,
My situation is the following:
- I have created a table named "Material" and the corresponding Card and List pages.
- I have extended the Item table to include this Material field.
- I have created an Item list page with only two fields ("No." and "My Description") and I want that page as my lookup.
I want to assign a default Item to a certain Material, so in the Material Card Page I have:
field("Default Sheet"; "Default Sheet")
{
ApplicationArea = All;
Tooltip = 'The Default Sheet is used to calculate the standard cost and will be carried out automatically to sheet part manufacturing';
LookupPageId = "Item Specific Lookup";
TableRelation = "Item" where("Material" = field("No.");
}
And when clicking on the Lookup I get the following. The preview page shows the page "Item Look Up", that is the page defined in the Item table in LookUpPageId.
If I click on "Select from full list" my "Item Specific Lookup" page is displayed. But I also want that page to be displayed in this preview because I need to see those two fields.
Is this possible?
I have worked a workaround using the trigger OnLookUp but that forces me display a Modal page and I would like to avoid that.
field("Default Sheet"; "Default Sheet")
{
ApplicationArea = All;
Lookup = true;
trigger OnValidate()
begin
CurrPage.Update();
end;
trigger OnLookup(var Text: Text): Boolean
var
Item: Record "Item";
begin
Item.SetRange("Material", "No.");
if Item.FindSet() then
if PAGE.RunModal(PAGE::"Item Specific Lookup" , Item) = ACTION::LookupOK then "Default Sheet" := Item."No.";
CurrPage.Update();
end;
}
Best regards,