So I have a Status Dropdown on a fragment page (used to edit database entries) that I want to send an email notification when the entry changes from "Pending" to "Ready to Build".
I am using the following code:
var widgets = widget.parent.descendants;
var to = '[email protected]';
var subject = 'New System Order: ' + widgets.ProjectName.value;
var msg = "A new order for [ " + widgets.ProjectName.value + " ] has been created for [ " + widgets.UsersPosition.value + " ]";
sendMessage(to, subject, msg);
You can see that I also have it pulling the Project Name/User Position in the subject/body of the email. These are Text Boxes on that Fragment page displaying the information from the entry.
All of these works great and exactly as desired when the Dropdown and the Text Boxes are all in the same panel. However, when I separate them into separate panels (for aesthetics) the system cannot find widgets.ProjectName.value or widgets.UsersPosition.value.
I'm assuming I just need to adjust the var widgets = widget.parent.descendants; line, but I don't know to what.
Any help would be greatly appreciated. Thank you.