RunFormMode Question - Trigger Edit/Create Accordingly?

drfsupercenterdrfsupercenter Member Posts: 15
edited 2013-08-08 in NAV Three Tier
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.
Sign In or Register to comment.