Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
Yes is it possible to update a record identified by a non-key field using script. Since you are hinting at the idea of having two key fields (which you can't do) I am going to assume the non-key field you want to base the update on is unique.
All you have to do is create a query for the record where the non-key field is equal to the given value and obtain the [Record ID#] for that unique record. Then edit that record specifying the now known [Record ID#] value and the values of the other fields you want to modify.
As a matter of fact if you use a Service Worker you can create your own API method and name it anything you want - perhaps something like this:
?act=API_UpdateTableUsingNonKeyField&nonkeyfield=foo&_fid_6=bar&_fid_7=baz
Within the Service Worker you detect that ?act=API_UpdateTableUsingNonKeyField is being requested and logic within the Service Worker will do the two step procedure described above and return a synthesized response indicating the composite result of the two steps.
It may sound wild but it very simple. Using a Service Worker you can create your own API methods and code them to do multistep procedures.
All you have to do is create a query for the record where the non-key field is equal to the given value and obtain the [Record ID#] for that unique record. Then edit that record specifying the now known [Record ID#] value and the values of the other fields you want to modify.
As a matter of fact if you use a Service Worker you can create your own API method and name it anything you want - perhaps something like this:
?act=API_UpdateTableUsingNonKeyField&nonkeyfield=foo&_fid_6=bar&_fid_7=baz
Within the Service Worker you detect that ?act=API_UpdateTableUsingNonKeyField is being requested and logic within the Service Worker will do the two step procedure described above and return a synthesized response indicating the composite result of the two steps.
It may sound wild but it very simple. Using a Service Worker you can create your own API methods and code them to do multistep procedures.