Forum Discussion

IBK's avatar
IBK
New Contributor III
2 years ago

SQL Table Editor column value other than the bound column

I have SQL Table Editor with about 70 columns. I have the bound column tied to a parameter. But I need to access the value of another column of the selected row based on a button click. I want to process that row in the BR function. PLease help.

  • Set the Bound column to a column that is a unique identifier for the data record.   Then in the business rule use that unique identifier and SQL to lookup the other fields/values that you need for that record.

  • Then in your rule, use something like the following to get the row (assuming its always one row) that has the value in it you're looking for:

    Dim uniqueID As String = args.NameValuePairs.XFGetValue("UniqueID", String.Empty)
    Dim lstEditedDataRows As List(Of XFEditedDataRows) =  args.SqlTableEditorSaveDataTaskInfo.EditedDataRows
    Dim btnClickUserRow As XFEditedDataRow = lstEditedDataRows.Where(Function(row)row.ModifiedDataRow.Item("UniqueID").Equals(uniqueID)).ToList().First()
    
    

     

  • SeanV's avatar
    SeanV
    New Contributor III

    Set the Bound column to a column that is a unique identifier for the data record.   Then in the business rule use that unique identifier and SQL to lookup the other fields/values that you need for that record.

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    Then in your rule, use something like the following to get the row (assuming its always one row) that has the value in it you're looking for:

    Dim uniqueID As String = args.NameValuePairs.XFGetValue("UniqueID", String.Empty)
    Dim lstEditedDataRows As List(Of XFEditedDataRows) =  args.SqlTableEditorSaveDataTaskInfo.EditedDataRows
    Dim btnClickUserRow As XFEditedDataRow = lstEditedDataRows.Where(Function(row)row.ModifiedDataRow.Item("UniqueID").Equals(uniqueID)).ToList().First()
    
    

     

  • IBK's avatar
    IBK
    New Contributor III

    Thank You folks. I was able to use the above logic and everything worked.