RunFormMode Question - Trigger Edit/Create Accordingly?

drfsupercenter
Member Posts: 15
Hey guys,
Ran into a bit of a snag, and I'm hoping there's an easy way to fix this using C/AL code or some other method. Right now I have a page that opens in Edit mode, which allows us to view and modify the current record. I have it intelligently pick the row of data to modify, since there should only be one per item record (the table I created it a subset of item, if that makes sense)
The problem is that if we don't have a row already created with that item number, it opens in a read-only state and won't let us input data. Unlike in the Classic client, using a form, the only way I can see to fix this is to do Action - New, then save it, then go back to the edit page. I tried setting the default view to Create, but the problem then is that you cannot edit data from that page once it's been inserted, it'll always try to insert duplicate lines.
Basically, I am looking for a way to have the page open in Edit mode by default, but that if there is no record to edit - change the view to create mode. As soon as the user clicks OK to close the page, if they open that page again from the actions menu, it'll open in edit mode (like I set it to from Page Actions), and they'll be able to see the data they previously entered.
It seems pretty straightforward, basically I want an "insert/update view", but I can't find any options in NAV to do that.
Ran into a bit of a snag, and I'm hoping there's an easy way to fix this using C/AL code or some other method. Right now I have a page that opens in Edit mode, which allows us to view and modify the current record. I have it intelligently pick the row of data to modify, since there should only be one per item record (the table I created it a subset of item, if that makes sense)
The problem is that if we don't have a row already created with that item number, it opens in a read-only state and won't let us input data. Unlike in the Classic client, using a form, the only way I can see to fix this is to do Action - New, then save it, then go back to the edit page. I tried setting the default view to Create, but the problem then is that you cannot edit data from that page once it's been inserted, it'll always try to insert duplicate lines.
Basically, I am looking for a way to have the page open in Edit mode by default, but that if there is no record to edit - change the view to create mode. As soon as the user clicks OK to close the page, if they open that page again from the actions menu, it'll open in edit mode (like I set it to from Page Actions), and they'll be able to see the data they previously entered.
It seems pretty straightforward, basically I want an "insert/update view", but I can't find any options in NAV to do that.
0
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