Below is the usage of $.when().then().
$.when(setLineDet(rptId, rptLn)).then(function(data) { console.log("done setting line details");