• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Putting specific keys into the text of a option menu
(04-28-2020, 06:42 PM)Jason Lam Wrote: Hi Sid,

The current supported pResultFormat from cdb_query is "recordList" and "recordData".

"recordList" might not be useful for your use case since it just returns a list of cdbRecordIDs.

If you choose "recordData", you will still have to use the repeat code that Efrain provided from previous post.

Alternatively, you could use cdb_list suggested by Mark to avoid using the repeat code.

Hi Jason,
I tried to use 'datagrid' as a parameter

It definitely works with "recordData" and the repeat code you guys helped with.

in the future though , that datagrid parameter would be a nice add-on

(02-10-2020, 06:26 PM)efrain.c Wrote: Hi sid,

The keys of the output array are recordIDs of the records. When you say "the keys of tBranchData", there is only one record in the table so there is only one recordID in the keys of tBranchData. Because of this, tBranchData[the keys of tBranchData] evaluates correctly. However, when you say "the keys of tTaxTypes", there are multiple records in the table so there will be multiple keys in tTaxTypes. Because of this, tTaxTypes[the keys of tTaxTypes] will not evaluate correctly.

The following is one way of creating the list you want:

repeat for each key xRecordID in tTaxTypes
  put tTaxTypes[xRecordID]["taxTypes"] & lf after tTaxTypesList
end repeat
delete char -1 of tTaxTypesList

set the text of button "taxType" of me to tTaxTypesList

For people who have a query with more than 1 rule, modify above to:

repeat for each key xRecordID in tDeptData[tTableID][1]
     put tDeptData[tTableID][1][xRecordID]["deptCode"] && " - " && tDeptData[tTableID][1][xRecordID]["departmentName"]  & lf after tDeptDataList
  end repeat

Forum Jump:

Users browsing this thread: 2 Guest(s)