Parameter | Description |
---|---|
iField (Optional) | Column number to apply to |
Property String Field_RememberedValue
Read Access: | Get Field_RememberedValue iField to StringVariable |
Write Access: | Set Field_RememberedValue iField to StringVariable/Value |
DD Remember allows you or your user to dynamically assign and remember a specific value. When you clear a view, this remembered value is used as the new default. You can also choose to remember the last value entered. When you clear a view, the value currently in the data entry object (DEO) will be used as the new default.
This can be assigned at the DD or at the DEO level. Even better, this can be set directly by your end users. Menu items can be added to your menus, context menus and tool bars to do this. This empowers your users and makes data entry faster and more flexible. No programming is required to support this
This works differently and properly with parent columns where you can remember an entire parent record.
Field_RememberedValue values are fully supported by the WebApp Framework and synchronized with the DDO synchronization process, so there is no need to create additional Web Properties to track these values.
If set, this specifies that this value should be used as the default.
Set Field_RememberedValue Field Customer.Name to "Smith"
If an empty value (blank) is passed, the remember value is removed for that column (it "unremembers").
Set Field_RememberedValue Field Customer.Name to ""
If the special value DD_RememberLast is passed, the DD will use the last value.
Set Field_RememberedValue Field Customer.Name to DD_RememberLast
A special case of remember is supported, that says "remember the last value", via DDFieldRememberLast.
Remember acts like field-defaults and is applied the same with Clear and Clear_All.
A remembered field takes precedence over a default field (Field_Default_Value).
This sample shows how to implement a default sales person in the Order sample view. This demonstrates that DD Remember even works with related parent tables.
Object SalesP_DD is a Salesp_DataDictionary Set Field_RememberedValue Field SalesP.ID to "FF" End_Object
Normally, this will be set dynamically and set at the object instance level. Therefore, this is not modeled in the DD class modeler. Most often, this will not be set directly but will be done indirectly by sending a DEO message (DDFieldRemember, DDFieldRememberLast, DDFieldUnRemember) or a DD message (ClearRememberedDefaults, ClearAllRememberedDefaults). Often menus will send these messages.
This sample shows how to retrieve a remembered value for a given DEO. This code can be used inside Order.vw, for example inside a Button or whevever you need it. It retrieves the remembered value for the OrderHea.Order_Number column. Keep in mind that each DataDictionary Object (DDO) in a view stores a set of remembered field values for DEOs connected to it. So it is imperative to request those values from the DDO that is the correct DDO for the DEO in question. You can access that by using Server and Which_Data_Set to get the DDO that "owns" the DEO.
String sOrderNo Handle hoDD Get Which_Data_Set of (Server(oOrderHea_Order_Number)) (RefTable(OrderHea)) to hoDD Get Field_RememberedValue of hoDD (RefTable(OrderHea.Order_Number)) to sOrderNo Send Info_Box sOrderNo "Remembered Value"
Menu classes have been provided (cCJRememberFieldMenuItem, cCJRememberLastFieldMenuItem, cCJUnRememberFieldMenuItem, cCJUnRememberFieldAllMenuItem) so these options can be selected from menus, toolbars and context menus. In addition,
we have changed our DEO context menu to support this.
Keep in mind that exposing this user interface will allow users to override a programmatically provided default using Field_RememberedValue. To avoid this issue, you can use Field_Defaults or Clear (to default parent table values).