Method for event OnAfterUnlock
- 7 years ago
Hi
onAfterUnlock action will have info about the ID and Type of the item type. We need to fetch information again to get the item number and state information.
// First Line is a debugger. You can debug server methods. Please have look at https://community.aras.com/b/english/posts/debugging-in-aras-innovator
// if (System.Diagnostics.Debugger.Launch()) System.Diagnostics.Debugger.Break();
var queryItem = this.newItem(this.getType(), "get");
queryItem.setAttribute("select", "item_number,state");
queryItem.setID(this.getID());
queryItem = queryItem.apply();
if (!queryItem.isError())
{
string itemnumber = queryItem.getProperty("item_number");
string state= queryItem.getProperty("state","");
if ( state != "Released" )
{
CCO.Utilities.WriteDebug("IP_ScadDocsPromote","Item = "+itemnumber +" State = " + state);
this.promote("Released","");
}
}
return this;Thank You
GK