This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
The highly anticipated Alteryx Community tradition is back! We hope you'll join us!
Learn MoreThere is something wrong with this code
Alteryx.Plugin.II_PushRecords = function (data) {
Alteryx.Engine.SendMessage.Warning("Before request");
$.ajax({
url: 'https://v1-17-1-4.semanta.cloud/x/admin/cleanstage',
type: "GET",
async:false,
data: {
loadCode: 'xxx',
username:'admin',
password:'somepassword'
},
success: function () {
Alteryx.Engine.SendMessage.Warning("success");
},
error: function () {
Alteryx.Engine.SendMessage.Warning("error");
}
});
Alteryx.Engine.SendMessage.Warning("After request");
Alteryx.Engine.SendMessage.PushRecords("T2", data.Records);
};
It is a part of a plugin that has one input and one output. I want the output to be exactly the same as the input, but as a side-effect, I want to synchronously (i.e. with blocking) call a web service. On running this, I get the following error message
Error: Designer x64: The Designer x64 reported: InboundNamedPipe::ReadFile: The pipe has been ended.
the web service is not called (I can check on the server, but also I see very little going on in Fiddler).
A few points
Thanks a lot !
Solved! Go to Solution.
success: function () {
Alteryx.Engine.SendMessage.Warning("success");
Alteryx.Engine.SendMessage.PushRecords("T2", data.Records);
Alteryx.Engine.SendMessage.CloseOutput(Alteryx.Plugin.DefineConnections().OutgoingConnections[0].name);
Alteryx.Engine.SendMessage.Complete();
},
error: function () {
Alteryx.Engine.SendMessage.Warning("error");
Alteryx.Engine.SendMessage.PushRecords("T2", data.Records);
Alteryx.Engine.SendMessage.CloseOutput(Alteryx.Plugin.DefineConnections().OutgoingConnections[0].name);
Alteryx.Engine.SendMessage.Complete();
}
The key here is to put all the finalization code into the callbacks ! That includes the PushRecords that I wrongly called at the end of the method and also the code that is usually in the Alteryx.Plugin.II_AllClosed method.
All hail JP Kabler for the much needed hint.