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

BT_Marc
Member Posts: 30
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
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
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
0
Comments
-
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 ?0
-
@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 Dev0 -
@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 RecordCurrJobTask.GET(NewJobTask."Job No.",NewJobTask."Job Task No.");
I changed it now toCurrJobTask.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. Thanks0 -
No problem, glad i can help, please mark the topic as resolved.Austrian NAV/BC Dev0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions