Issue updating rows in a dataset via perl api

LabKey Support Forum (Inactive)
Issue updating rows in a dataset via perl api WayneH  2017-10-30 10:15
Status: Closed
 
note: when I try to delete data in my test table using the deleterows function in javascript... it won't work unless I specify 'lsid' as the "key" which makes sense to some extent as the table definition shows 'lsid' as the primary key for this table. Problem is I don't know what are the values for this field and I can't seem to figure out how to do a global delete which is ultimately what I would like to do. When I use the example shown below it claims success but it does not change the table..

Using anything else gives the following error "No lsid, and no KeyManagement"

W

js sample:

<p><button onclick="onSubmit()">Click me to delete a record</button></p>

<script type="text/javascript">

function onSubmit(){
LABKEY.Query.deleteRows({
    requiredVersion: 16.3,
    schemaName: 'study',
    queryName: 'test',
    rows: [{'lsid':'1'}],
    success: onSuccess
});

function onSuccess(results) {
                  alert('Success!');
                 }
}
</script>