Options

How to select Item from Lookup page

IvonaKIvonaK Member Posts: 114
Hi to all,

I have add a new page Action in P 31: Item List (picture 1).xtjrq7zyu2o6.jpg

When I call Action it is open a new page like picture 2.vztiexb77t5m.jpg


I want when I select Item No from picture 2, to be selected in P: Item List.

Here is code that I have in Action in P 31:"Item List"

IF PAGE.RUNMODAL(50005,ItemAttributesFilters)=ACTION::LookupOK THEN
BEGIN
Item.GET(ItemAttributesFilters."Item No.");
// CurrPage.GETRECORD(Item);
// CurrPage.SETRECORD(Item);

CurrPage.SETSELECTIONFILTER(Item);
CurrPage.UPDATE;
END;

I try with, GETRECORD,SETRECORD,SETSELECTIONFILTER but still it doesen't work :neutral:
I use NAV 2016.

Any advice,
Thanks a lot,

Answers

  • Options
    Wisa123Wisa123 Member Posts: 308
    1.) Create your additional page as a Variable (pageVar)
    2.) Filter a ItemRec to your needs
    3.) PageVar.settableview(<filtered itemrec>)
    4.) pagevar.runmodal
    5.) pageVar.getRecord(someOtherItemRec);
    6.) Rec.Setrange(someOtherItemRec."no.") -> Rec beeing your actual Record from the calling Page (rec)
    7.) currpage.update(false)

    Just writing up without actually trying it.
    Should work like this though, if you need further help feel free to pm me the objects.
    Austrian NAV/BC Dev
  • Options
    IvonaKIvonaK Member Posts: 114
    Hi Wisa123,

    It works now with your advice.

    Thanks a lot of :smile:
    Best Regards,
  • Options
    BeliasBelias Member Posts: 2,998
    edited 2016-02-12
    To keep it simple (hopefully i understood what you want to do)
    if page.runmodal(50005,ItemAttributesFilters)=ACTION::LookupOK THEN
    get(itemattributesfilters."item no.");
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    IvonaKIvonaK Member Posts: 114
    Hi Belias,

    Yes you are right. Also it works like that.

    Thanks a lot of :smile:
    Best Regards,
Sign In or Register to comment.