Hi Guys
I have a question regarding cloud updates to records with NUMBERS or Currency figures (well-all are numbers)in them:
for example , l'm doing stock control and I need to update 2 records , onHand and grossProfit (these are keys on the cloud database
so , as I understand it, you have to get the original key value for the above and store them into local variables and then do the calculation, for example, initially theres a 100 in onHand and $1000 in Gross profit. You sold 10 and made a buck on each thingummy you sold. so the calc is simple and your updated values are 90 in onHand and $1010 in grossProfit.
Imagine that there are 2 users hitting the same record in the scenario, one of them is offline ..What happens then?
one guys sells the 10 , but the offline guy sells 50, so the correct values when the offline guy comes online and the cloud databases sync should be 40 in onHand and $1060 in grossProfit. It becomes more syncfusing if there are more people hitting that calculated key and a few of them are offline.
will it sync correctly, ie parse and do the calculations correctly ? (remember there are local variables involved)
Correct me if this already exists , but ideally this should be a query operator update , meaning you minus 10 from the existing cloud value rather than overwriting the value .
cdb_updateValue(tTable,tRecordID,tKey,tOperator,tValue,tTarget) into tCalcEffect
cdb_updateValue("transactions",tRecordID,"onHand","-","10","cloud") into tCalcEffect
this be a very important feature. Does it exist? Or do you have to handle calculated syncs by writing code?
For anyone else reading this:
I forgot to say that the above command does not exit vis, cdb_updateValue.
I just used it as an example of how i think this should be handled, It will should also only work on numeric values for obvious reasons,
I have a question regarding cloud updates to records with NUMBERS or Currency figures (well-all are numbers)in them:
for example , l'm doing stock control and I need to update 2 records , onHand and grossProfit (these are keys on the cloud database
so , as I understand it, you have to get the original key value for the above and store them into local variables and then do the calculation, for example, initially theres a 100 in onHand and $1000 in Gross profit. You sold 10 and made a buck on each thingummy you sold. so the calc is simple and your updated values are 90 in onHand and $1010 in grossProfit.
Imagine that there are 2 users hitting the same record in the scenario, one of them is offline ..What happens then?
one guys sells the 10 , but the offline guy sells 50, so the correct values when the offline guy comes online and the cloud databases sync should be 40 in onHand and $1060 in grossProfit. It becomes more syncfusing if there are more people hitting that calculated key and a few of them are offline.
will it sync correctly, ie parse and do the calculations correctly ? (remember there are local variables involved)
Correct me if this already exists , but ideally this should be a query operator update , meaning you minus 10 from the existing cloud value rather than overwriting the value .
cdb_updateValue(tTable,tRecordID,tKey,tOperator,tValue,tTarget) into tCalcEffect
cdb_updateValue("transactions",tRecordID,"onHand","-","10","cloud") into tCalcEffect
this be a very important feature. Does it exist? Or do you have to handle calculated syncs by writing code?
For anyone else reading this:
I forgot to say that the above command does not exit vis, cdb_updateValue.
I just used it as an example of how i think this should be handled, It will should also only work on numeric values for obvious reasons,