12-14-2019, 11:27 PM
Hi Efrain
Thank you very much man
I used that bit of code to populate the datagrid successfully and did a dance of joy, I had to modify it slightly to work with the datagrid helper plugin.
Anyway, Im new to programming and am trying to use livecloud to build a retail system I have dreamed about. A lot has to do with queries between dates so I modified your code to include a code snippet that LCM produced . It works on LCM and I get the records between the 2 dates and i was happy...but I cannot get it to repopulate the datagrid with the results. Here is the code...Im hoping you can tell me where I went wrong:
I tried messing with it , by changing the tTableID to tKeys and hoping it will work, but nothing, some of the commented code I uncommented to see if putting the data into tOutputA will work
I know the query works on LCM.
WIll appreciate the help
Thank you very much man
I used that bit of code to populate the datagrid successfully and did a dance of joy, I had to modify it slightly to work with the datagrid helper plugin.
Anyway, Im new to programming and am trying to use livecloud to build a retail system I have dreamed about. A lot has to do with queries between dates so I modified your code to include a code snippet that LCM produced . It works on LCM and I get the records between the 2 dates and i was happy...but I cannot get it to repopulate the datagrid with the results. Here is the code...Im hoping you can tell me where I went wrong:
Code:
on mouseUp
put empty into field "searchAllField"
put empty into field "foundLogsLabel"
put "Search all fields by typing here" into field "searchAllFieldsLabel"
local tKeys, tOutputA, tCount, tDataA, tInputA
--code snippet
set the dgData of group "DataGridLogs" to empty
put cdb_TableID("logs") into tTableID
//put cdb_tableKeys("logs") into tKeys
put "date" into tInputA[tTableID]["query2"]["key"]
put "<=" into tInputA[tTableID]["query2"]["operator"]
put "12/13/19" into tInputA[tTableID]["query2"]["value"]
put "date" into tInputA[tTableID]["query1"]["key"]
put ">=" into tInputA[tTableID]["query1"]["operator"]
put "12/01/19" into tInputA[tTableID]["query1"]["value"]
put cdb_batchQuery(tInputA,"cloud","logicalAND","recordData") into tOutputA
--
//put cdb_read("logs", "*", "cloud") into tOutputA
put 0 into tCount
repeat for each key xRecordID in tOutputA
add 1 to tCount
put tOutputA[xRecordID]["cdb"]["cdbRecordID"] into tDataA[tCount]["recordID"]
repeat for each item xKeyName in tTableID
put tOutputA[xRecordID][xKeyName] into tDataA[tCount][xKeyName]
end repeat
end repeat
set the dgData of group "DataGridLogs" to tDataA
set the dghProp["saved data"] of group "DataGridLogs" to tDataA
//set the dgData of group "DataGridLogs" to tOutputA
//set the dghProp["saved data"] of group "DataGridLogs" to tOutputA
end mouseUp
I tried messing with it , by changing the tTableID to tKeys and hoping it will work, but nothing, some of the commented code I uncommented to see if putting the data into tOutputA will work
I know the query works on LCM.
WIll appreciate the help