xTuple.com xTupleU Blog & News Customer Support

Sales Order Cluster New ID trigger

In a screen - I’m trying to trigger a function off the salesorder cluster - using the following

var _assign = mywindow.findChild("_assign");
var _unassign = mywindow.findChild("_unassign");
var _salesorder = mywindow.findChild("_salesorder");
var _knllist = mywindow.findChild("_knllist");
var _assignedlist = mywindow.findChild("_assignedlist");
var _update = mywindow.findChild("_update");
var _unassignAll = mywindow.findChild("_unassignAll");
var _currentlist = mywindow.findChild("_currentlist");
var _link = mywindow.findChild("_link");

mywindow.findChild("_close").clicked.connect(mywindow.close);
//toolbox.messageBox(“Test”, mainwindow, “test” ,“test”);

//connections
_assignedlist.itemSelected.connect(unassignLine);
_knllist.itemSelected.connect(assignPo);
_unassignAll.clicked.connect(unassignall);
_assign.clicked.connect(assignPo);
_unassign.clicked.connect(unassignLine);
_currentlist.itemSelected.connect(removeLink);
_link.clicked.connect(createLink);
_salesorder[“newId(int)”].connect(coheadLink); <-- specifically this line here
_update.clicked.connect(coheadLink);

function coheadLink()
{
var coheadparam = new Object;
coheadparam.coheadid = _salesorder.id();
cqry = toolbox.executeDbQuery(“northway”, “knlCoheadAssigned”, coheadparam);
_currentlist.populate(cqry);

Everything else currently works for it - including using the Update button to run the same function - but I would prefer it to trigger off a new Id selection to limit any potential operator errors. I’ve usedthe newId(int) trigger before without issue but never with a sales order cluster. Is it possible or does something else need to be done to get it to trigger?

The trigger needs to be: _salesorder[“newId(int, QString)”].connect(coheadLink);

Kindly,
javier

Javier is correct. Just to clarify, the order cluster is used for several order types (S/O, P/O, and possibly W/O) so the int parameter gives you the ID, and the QString parameter gives you the order type (SO, PO etc)