Generally when we worked on designing detail EP form we have two options to open EP form in Insert and Edit mode, either design two separate EP forms with same piece of code except Design mode property set to Inset or Edit. Different way is to create single EP form and write code behind to open form in either mode. to do this design your EP form and create two web menu items and set parameters as follows
You are all set to see this dynamic behavior. just to recap here are the steps:
- Design and deploy new form with default ReadOnly mode
- Create separate web menu items for Edit and Insert operations and set property Parameter=‘mode=1’ for Edit or ‘mode=2’ for insert.
- Get the session object by creating property AxSession
- Create FormMode() method in Form1.aspx.cs to get mode via a query string.
- Create SetupMode() method in Form1.aspx.cs