You could create an item directly in the 'On Apply' code of the edit field, so it would probably be more convenient to add a button to the dashboard that does this.
First, link the edit field to a node in the model. In the attached model I used a label on Queue1 for this. Now other parts of the model can access the value in the field through that node.
I linked the button to the queue (for an easy reference to the label and because I want to create the item in the queue). In its 'OnPress' code I then create an instance of an object in the FlowItem Bin with the same name as the text in the edit field.
treenode link = node("..>objectfocus+", c);
// Read the label on the queue
string itemName = link.Create;
// Create item in model
Object item = createinstance(Model.find("Tools/FlowItemBin/" + itemName + "/1"), model());
// Move item into queue
moveobject(item, link);If you dont want to use the name (or rank) of the flowitem directly, you can of course write if-conditions such as the following, to determine the correct item type.
treenode link = node("..>objectfocus+", c);
string itemName = "";
string itemCode = link.Create;
if(itemCode == "B11") {
itemName = "Box";
}
if(itemCode == "P22") {
itemName = "Pallet";
}
if(itemName != "") {
Object item = createinstance(Model.find("Tools/FlowItemBin/" + itemName + "/1"), model());
moveobject(item, link);
}CreateItem_Dashboard_fm.fsm