I have a custom button created in Ribbon Workbench named "send email" (for short) in which the following is intended to occur: create email record-->insert email template via service-->open in modal for user.
With that being said, I have created the following Ribbon Workbench button configs:
As you can see, I have added the parameter that passes the execution context and the parameter that is supposed to pass the form object if I'm not mistaken.
I have written javascript which is triggered by the button. The javascript fires and works but fails when attempting to grab the record id. The following is my javascript snippet:
function ltCreateIAafterPurchaseTemplate(executionContext, item){
alert("AFTER PURCHASE");
var formContext = executionContext;
var emailTemplateToLoad = "f22cb309-1fd9-eb11-bacb-000d3a361c51";
var selectedItem = item[0];
alert("selectedItem: " + selectedItem.Id);
}
Above item
parameters is passed with the object data I need, and to my knowledge the statement var selectedItem = item[0]
is the correct way to get it. However, I receive the following error in the alert when trying to show the id alert("selectedItem: " + selectedItem.Id);
in console:
After hovering over the param passed in, it has a length of 0 stating its empty: