• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Batch_update a specific key in a number of records
#1
Hi Guys

I am getting along well , but ran into a bit of a problem.

I have an exchange rate table and want to batch update all of the selected keys with a given value (its the same value )

so here is the code I used , 

First a query getting the records I need and placing all the record ID's into an array. (list Query)

The Message Box says the records don,t exist.....but they do, Am I missing a repeat string here?  or is this code completely wrong?

The aim is basically to mass edit a specific key in a selected number of records . (change all the values in the key to the one specified)

Code:
local tExchangeInput, tExcCode, tTarget, tcurrencyTypesTableID, tDataE
global gDefaultCurrCountry, gDefaultCurrCode

on mouseUp pButtonNumber
 
  put field "exchangeInput" into tExchangeInput
 
  put "cloud" into tTarget
  put cdb_tableID("currencyTypes") into tcurrencyTypesTableID
 
  local tInputA, tOutputA
  put cdb_query("currencyCode","=",gDefaultCurrCode,"currencyTypes","cloud","recordList") into tOutputA
 
 
  put tExchangeInput into tDataA[tcurrencyTypesTableID][tOutputA][exchangeRateNative]
 
  cdb_batchUpdate tDataA,tTarget
 
end mouseUp



This is a copy and paste from the message box:

(2020-04-01 15:55:00.207): The specified cdbRecordID is invalid: 0786d7b9-55fd-4e15-8287-ea8c5a790af0
27669565-562d-49ea-b653-e3b88857836d
4fb57c38-1aff-4eb8-a7a9-6539adac879e
644ba8a1-98a0-45f2-afc6-3275772684e1
66ce54b7-ae36-48a1-8cd6-e6959bf29113
680b85ff-3b81-47fa-88e1-a64d5728f8bd
735df545-4105-4b5c-ba03-a6d3d261ce3f
795d0ba2-e5ed-4e6f-b349-36b41a647259
98493da8-2e6f-4b2d-ae79-51563ba7ab39
a654bda3-2eca-438f-b5f6-44dc3edc1cdc
fefdb650-015d-4543-a22b-313d3ffe6580


these actually do exist.

Also is there a way to use a checkbox in a datagrid row that can mass edit the records that are checked. It would be great if you can put up an example in the datagrid part of the forum for that. A lot of people will find both of these very useful

Thanks again,
Sid
  Reply


Messages In This Thread
Batch_update a specific key in a number of records - by sid - 04-01-2020, 02:11 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)