Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Last active April 22, 2019 13:44
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/b165c962a9d8867d31868c22521314c2 to your computer and use it in GitHub Desktop.
Save cgillis-aras/b165c962a9d8867d31868c22521314c2 to your computer and use it in GitHub Desktop.
Gets the related option value from the relationship grid. This is intended to be called from an OnInsertRow event.
// Gets the related_option property from the relationships grid from an OnInsertRow event
var relOptionDropdown = this.toolbar.getItem("related_option");
// You can either perform your logic on the selected value or the selected index
/*
* Possible selected item values:
* "Create Related"
* "Pick Related"
* "No Related"
*/
var selectedItem = relOptionDropdown.getSelectedItem();
switch (selectedItem)
{
case "Create Related":
alert("Create Related option is selected");
break;
case "Pick Related":
alert("Pick Related option is selected");
break;
case "No Related":
alert ("No Related option is selected");
break;
default:
alert("Related Option not recognized");
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment