Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Last active January 12, 2021 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgillis-aras/3d0b8a653e7895037cf77e721c754d02 to your computer and use it in GitHub Desktop.
Save cgillis-aras/3d0b8a653e7895037cf77e721c754d02 to your computer and use it in GitHub Desktop.
Sample code for a hard-coded version of an action that will get the name of the User who has claimed a selected Part
Innovator inn = this.getInnovator();
// Check to see if this item is claimed at all
if (this.isLocked() == 0)
{
return inn.newResult("No one");
}
// Query to make sure that we have the locked_by_id property
Item part = inn.newItem("Part", "get");
part.setID(this.getID());
part.setAttribute("select", "locked_by_id(keyed_name)");
part = part.apply();
// Get the name of the user who locked this part
Item claimer = part.getPropertyItem("locked_by_id");
string claimerName = claimer.getProperty("keyed_name");
return inn.newResult(claimerName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment