Hi John,
I'm using Windows 10, PB 2019 R3 Build 2703.
1. Data type of the column (index) is String (char 1)
2. Properties:
a. Required
b. Always Show Arrow
c. AutoRetrieve (off)
d. DataWindow dddw_approval_status
e. Display Column Approval_status
f. Data Column idapproval_status
3. Code:
datastore lds_staging
lds_staging = CREATE datastore
lds_staging.DataObject = "d_expense_staging_load"
lds_staging.SetTransObject (SQLCA)
lds_staging.Retrieve(il_master)
ii_approver = lds_staging.GetItemNumber(1, "stager")
For li_col = 1 to Long( Tab_1.TabPage_1.dw_1.Object.DataWindow.Column.Count )
Tab_1.TabPage_1.dw_1.Modify( "#" + String( li_col ) + ".Protect = 1" )
Next
ls_status = Tab_1.TabPage_1.dw_1.GetItemString(1, "status")
Choose Case ls_status
Case "S"
If ii_approver = g_loggedon_emp_no Then
Tab_1.TabPage_1.dw_1.Modify("status.Protect = 0")
Tab_1.TabPage_1.dw_1.Modify("return_reason.Protect = 0")
Else
Tab_1.TabPage_1.dw_1.Modify("status.Protect = 1")
Tab_1.TabPage_1.dw_1.Modify("return_reason.Protect = 1")
End IF
ls_filter = "idapproval_status= 'S' Or idapproval_status= 'A' Or idapproval_status= 'R'"
Case Else
Tab_1.TabPage_1.dw_1.Object.DataWindow.Readonly = True
End Choose
DataWindowChild child1
Tab_1.TabPage_1.dw_1.GetChild( "status", child1)
child1.SetTransObject(SQLCA)
child1.setfilter(ls_filter)
child1.Filter()
child1.Retrieve()
4. All values from the dddw table are present. The initial record retrieved has a Status of "S" for Submitted and it renders fine (display shows Submitted). First click on the dddw then changes the display to "S" and the filtered displays all show in the dddw including Submitted. Also, removing the filter and doing an auto retrieve makes the dddw work fine.
James