SetWindowProperty (windowRef, propertyName, value)

Result Type:  none

Definition:  Store property data for a window handle for later retrieval by GetWindowProperty. This effectively provides per-object storage for windows. This is particularly useful for scripts that deal with multiple instances of the same class of window (like Transaction windows). The property data is automatically released when the window closes.


on Before:My_Window(w)
    SetWindowProp(w, "my_wind_fields", ReadCurrentRecordForWindow(w))

on After:My_Window(w)
    let a = GetWindowProp(w, "my_wind_fields")
    // .. set values in a
    WriteCurrentRecordForWindow(w, a)

Availability:  within an MWScript handler in MoneyWorks Gold 8.1.8 and later

See Also:

GetWindowProperty: Retrieve data previously stored for a windowHandle

ReadCurrentRecordForWindow: Load a record in custom UI, or tagged fields in standard UI

WriteCurrentRecordForWindow: Save a record in custom UI, or save tagged fields in standard UI