Set the Default Value Based on the Parameter

  • First we would like to prevent the user from changing the value of OrderID on our "ShowOrderDetails" view.
  • To do that we'll select the TextBox bound to "OrderID" in the "ShowOrderDetails" view and change the AllowFocus property to false. It'll prevent the user from parking on this TextBox and changing it's value
  • To set the value received as parameter for "OrderId" as the value for new rows in the "Order_Details" table, we'll set the "OrderID" column's DefaultValue property
public void Run(Number OrderId)
{
    Order_Details.OrderID.DefaultValue = OrderId;
    Where.Add(Order_Details.OrderID.IsEqualTo(OrderId));
    Execute();
} 

Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com