Options

Add new Records with an action are not shown on [SOLVED]

BT_MarcBT_Marc Member Posts: 30
edited 2015-07-13 in NAV Three Tier
Hi all,

i have a list page that shows a table. on this page i have an action for creating new records. This action runs a function in a codeunit which finally creates the new record. The problem is that the records which are created from the codeunit will not be displayed on the page. Even Refreshing (F5) doesn't help. The only thing that helps is closing the page and open it up again.
i even tried to add
SELECTLATESTVERSION;
CurrPage.UPDATE(FALSE);

but it has no effect. Does anyone know a solution for that problem?

Step by Step:

1. open the page
2. Click the action
3. Codeunit Function get's called
4. Record is created but not shown
5. Refresh doesn't help
6. the code up doesn't help
7. Closing the page
8. Open the page again
9. Record is shown

Thanks a lot for your help,
Marc

Comments

  • Options
    MBergerMBerger Member Posts: 413
    Without seeing the function it will be difficult to say what is going wrong, but there comes one thing to mind that could be the cause here : maybe the record variable in your codeunit, the one to which you add you new record, is set to Temporary ?
  • Options
    Wisa123Wisa123 Member Posts: 308
    @BT_Marc that doesnt make sense, otherwise the records wouldnt show up after reopening the page.

    My guess is, that your Action somehow sets a filter on the current Rec, and after that the records are inserted, but do not match the filter criteria.
    Looking for rec.setrange, ... might help you find the issue.
    Austrian NAV/BC Dev
  • Options
    BT_MarcBT_Marc Member Posts: 30
    @MBerger It's not temporary cause the record is in the DB and will be shown after a reopen of the Page.

    @Wisa123 You are right after i checked that i found a line at the end of the function where it goes back to the page with VAR Record
    CurrJobTask.GET(NewJobTask."Job No.",NewJobTask."Job Task No.");
    

    I changed it now to
    CurrJobTask.RESET;
    CurrJobTask.SETCURRENTKEY("Job No.","Position No.");
    CurrJobTask.SETRANGE("Job No.",NewJobTask."Job No.");
    CurrJobTask.FINDSET;
    CurrJobTask.GET(NewJobTask."Job No.",NewJobTask."Job Task No.");
    

    and now it works like expected. Thanks a lot for your help. I was really looking for a long time about this issue. Thanks
  • Options
    Wisa123Wisa123 Member Posts: 308
    No problem, glad i can help, please mark the topic as resolved.
    Austrian NAV/BC Dev
Sign In or Register to comment.