问题
I've created form that should insert, edit and delete row by usig CommandButtons. Propierity is set in Command field to New, Edit record and delete.
Generally it works, but its not safe, because it is editing rows without using CommandButton.
I don't know how to make data Source or CommandButton propierities to edit record only with button, not automatically.
回答1:
This is how standard AX 2012 forms behave, if created using form templates as described here.
To create a form with a template, right-click Forms in the AOT, click New Form from template, and then click the template that specifies the type of form you want to create. A form is generated from the specified template. The new form contains controls that implement the form structure specified by the design pattern for that form. In addition, several properties are populated with values that apply to the specified type of form. To complete the form, you add controls that provide access to the data and actions that the form supports.
Consider using the SimpleListDetails
form template. The grid has AllowEdit
set to No, while the details part allows editing, if in edit mode. Whether edit or view mode is the default is a user setup.
回答2:
Ok...using all properties combination there is simple way:
Just set on Menu Item "OpenMode" to "Viev" and editing is disabled utill user use right CommandButton.
来源:https://stackoverflow.com/questions/25147864/dynamics-ax-2012-commandbutton-insert-and-edit-by-form