Forum Discussion
_anomDiebolt_
9 years agoQrew Elite
I think the essential problem you are having is associated with this statement:
"so I can use it farther down in the nested set of promises?"
Promises should not normally nest - they should chain instead:
However there is a problem with the version of jQuery QuickBase uses (1.7.2) where you have to use the pipe() method instead of then() to properly pass responses to the next then() in the chain.
The only reason you should see nesting (even in some of my earlier code) is to avoid using jQuery's pipe() method as it is deprecated in more recent versions.
It is a weird scenario caused by QuickBase not updated their version of jQuery beyond 1.7.2
Also you are using a lot of old constructs - even if you drew them from some of my older code.
For example
Should probably be replaced by this idiom which removes the promise0 variable and chains directly into the next level of the pipeline:
I have a limited amount of time now but I will reply further as there are a lot of other things in your code that are just line noise which makes it difficult to debug.
"so I can use it farther down in the nested set of promises?"
Promises should not normally nest - they should chain instead:
$.get(...)
.then(function(xml) {
return $get(...)
}).then(function(xml) {
return $get(...)
}) .then(function(xml) {
return $get(...)
})
However there is a problem with the version of jQuery QuickBase uses (1.7.2) where you have to use the pipe() method instead of then() to properly pass responses to the next then() in the chain.
The only reason you should see nesting (even in some of my earlier code) is to avoid using jQuery's pipe() method as it is deprecated in more recent versions.
It is a weird scenario caused by QuickBase not updated their version of jQuery beyond 1.7.2
Also you are using a lot of old constructs - even if you drew them from some of my older code.
For example
var promise0 = $.get(LeadAssignmentTaskTableId, {
act: "API_DoQuery",
query: "{\'3\'.EX." + AssignedTask + "}",
clist: "7.8.9.12.56.77.44.5"
});
$.when(promise0).then(function(xml) {
console.dirxml(xml);
});
Should probably be replaced by this idiom which removes the promise0 variable and chains directly into the next level of the pipeline:
$.get(LeadAssignmentTaskTableId, {
act: "API_DoQuery",
query: "{\'3\'.EX." + AssignedTask + "}",
clist: "7.8.9.12.56.77.44.5"
}).then(function(xml) {
console.dirxml(xml);
});
I have a limited amount of time now but I will reply further as there are a lot of other things in your code that are just line noise which makes it difficult to debug.