Value assignment issue | Ben Bimber | 2015-04-29 09:46 |
Status: Closed | ||
I think there's also an issue of the asynchonous call. see the console output from this: LABKEY.Query.selectRows({ schemaName: 'lists', queryName: 'Main List', success: onSuccess }); function onSuccess(data) { console.log('i will be called second, because the call to the server is asynchronous'); requirementId = data.rows[data.rowCount-1].Name; } console.log('i will be called first, before the call to the server returns.'); alert(requirementId); Bront is also right that you'd have a scope problem too. His suggestion about a new function that is call is probably a good one. however, if onSuccess ends up with only 2 lines (setting the variable and then calling your new function), you might consider just putting your code there. |
||