![image](https://us.v-cdn.net/6026663/uploads/editor/7u/cfhdd2jd33g3.png)
IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.
DISCLAIMER
All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.
Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.
Dont forget to checkout solutions uploaded by our customers, partners and community members here.
Comments
Hey Brad,
I find the most effective way to send the email when the manual activity status changes to "In progress" is to use a custom workflow which kicks off a powershell script to send the email (rather than a runbook), as this allows for you to be extremely granular with your execution criteria (essentially the same granularity as you would have when setting up an e-mail notification).
if you have not looked at creating workflows before, I highly recommend giving it a go, as it provides a lot more flexability than runbooks for these types of scenarios.
Regards,
Adrian
Hi Seth, great post. I've implemented it and imported the Cireson DevOps extensions, and checked the enumeration ID matches, but the drop down isn't appearing in my MA forms. I've copied the contents of the .js to my custom.js. Is there something extra I should be doing?
Specifically all references to "activity.SupportGroup.Id" needed to be updated to "activity.AssignmentGroup.Id"
We are trying to add a second custom enumeration list to the Manual Activity form using this method. We've customized the script here to work with our other custom enum by modifying the enumeration GUID, the Manual Activity property name, and changing variable names from "support group / sg / supportgroup / etc." over to new names for our custom enumeration.
Our customizations work flawlessly when they are the only additional enumeration added to the form. There does not seem to be a problem inherent in the customizations.
However, when we add both our custom script AND the Support Group custom script to the custom.js file, we get some unexpected behavior - both enumerations are added and behave correctly, except that they both display the values of whichever script ran second.
We've tested changing the order of the scripts and validated that the displayed list values will always be those of the script that ran second. This tells us that both are functioning, but something in the script logic that performs the binding between the custom drop-down lists and the list values appears to be updating both inserted drop-downs rather than just the one being inserted at the time.
We've tried identifying which part of the script is causing this behavior, but we've been unable to identify it (our Javascript abilities are not expert-level, so it is possible we're overlooking something obvious, but there doesn't seem to be a clear link to us).
Would @seth_coussens or anyone else with JS skills be able to assist with customizing the script to address the issue?
Yes, definitely. I've attached two archives to this post, one with the customized code specifically for our custom enumeration (Business Unit) and one that combines the existing Support Group code and the Business Unit code in the same JS file. The only change made from the Support Group code as provided was running it through a JS formatter; the content of the code is the same.
Thanks!
and
Basically, you are selecting the same elements each time and linking them to the kendo control, so the second run overwrites the first in a fashion. You need to add something in that uniquely describes each control that you are then selecting.
Does that make sense?
var list = $('<select id="group-selector" data-activity-id="' + id + '" />');
and
var selectString = '#group-selector[data-activity-id="' + id + '"]';
to
var list = $('<select id="group-selector" data-activity-id="' + id + '-SupportGroup" />');
and
var selectString = '#group-selector[data-activity-id="' + id + '-SupportGroup"]';
, respectively. (Adding the suffix '-SupportGroup' for the support group list and '-BusinessUnit' for the business unit list.)
I'm attaching the complete, working code to this post to assist anyone else with the same need later.
Thank you very much for the help!
Further testing of the above solution has revealed that it isn't actually working - while the two lists are properly added to the Manual Activity form, populated with the correct list options, and appear to work, nothing is actually saved when clicking the "Save" or "Apply" buttons.
I've been working on troubleshooting the script and testing various parts (using the Chrome browser's developer tools) but been unable to determine specifically where the script fails. The summary of what I'm seeing is this:
I'm attaching our custom.js file to this comment for you to review in hopes that you may have some ideas. You'll see that only one of the custom lists is added currently, with the code to add the second fully commented out. The one that is added is the "BusinessUnit" list, but the code for the two is otherwise the same (aside from function name changes and tag changes ("-BusinessUnit" and "-SupportGroup"). You'll also see the lines where we've added the list name tag alongside the original lines, which have been commented out.
Any assistance you could provide would be greatly appreciated. Thanks!
Can you help out @Gabriel_Taylor or get someone from your team to take a look?
Taking a brief look at your code, I think the issue lies with this portion here:
The code as it has been modified would not find anything in the selector here, as it is trying to find elements that do not have your -BusinessUnit or -SupportGroup suffix appended to it. As a first step, you could try adding that BusinessUnit/SupportGroup suffix to the attribute here.
If that does not do the trick, another thing you can try would be to distinguish "uniqueness of the SupportGroup vs BusinessUnit dropdown" lists at the <select> statement's id-level, rather than at the data-activity-id's attribute level. For example, the original code that defined this was like this (and similar in other parts of the script):
and you changed it to this:
var list = $('<select id="group-selector" data-activity-id="' + id + '-BusinessUnit" />');
var list = $('<select id="group-selector" data-activity-id="' + id + '-SupportGroup" />');
try this instead:
var list = $('<select id="group-selector" data-activity-id="' + id + '" />');
Hope that helps!
Thanks,
Nick
As to your first suggestion, regarding the search string, we had actually tried that. Making the suggested change there broke everything, while leaving that in the original state allowed things to work. I had the same expectation as you listed, that it would make sense for that to be changed too, but testing proved quite otherwise.
The second suggestion sounds good - I hadn't realized I could change that Id value safely so I hadn't tested that yet. I'll make that change and test it and let you know how it goes. Thanks!
I'm attaching the final, working solution here in case anyone else needs it later.
How could I add two more date fields in the manual activity?
@Keren_Marroquin did you manish to add those fields to the manual activity?