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
Edit. Yep. Confirmed in our test environment.
Thanks for responding. I was able to actually figure this one out and it was user error. I wound up recreating the RO and everything worked as intended. Thanks to everyone who has contributed to this project because it's been a great help!
We are trying out the RO toolbox in our environment and we're loving it! When I was thinking of the possibilities that could be done with the RO toolbox, I wanted to test out if @placeholder works with other types of prompts apart from the text fields. Yes, for queries you can certainly use the @autocomplete and @multiselect feature, but what about the date, simple list, integer inputs ? The @placeholder functionality doesn't seem to work there, which is a bummer!
See the attachement - I have a @Placeholder above the date prompt named "when" in SCSM, but nothing shows on the portal. Same stuff goes for dropdowns as I pointed out.
Is there any way this could be enabled on these types of inputs as well? Through this we would be able to create some really clean looking request offerings!
Thanks in advance.
Directly below is the error I get in my Chrome dev tool when I try to use @ShowHideCriteriaOR with a 'contains' condition.
Error: [$parse:syntax] Syntax Error: Token ',' is unexpected, expecting [)] at column 18 of the expression [( (prompt63.value, 'contains', '1622f5bd-f50b-0a91-9a34-58dcdbdcb79d,f65a6e70-2a54-9684-c263-0140e09d5adb,6d7ec66a-cc7f-31c4-0abe-4eea8c93aa2f')) || (prompt62.value, 'contains', 'f65a6e70-2a54-9684-c263-0140e09d5adb,709f6ca6-a460-9003-39fd-047ce2dc1bcc,79daa23d-33e4-48b0-d88b-06ad0771d2ad,d1db0588-f159-fc9d-8866-09a8ce9e0ab7,1a8a20d5-01c4-a32d-c440-0b25bcbd0cc3,76f71819-d62b-4b0b-7450-0e371f4ca61a,d09067d6-a825-9220-4da0-20429359e6ef,b9b8f22d-9eb6-0055-1581-478fbe0009f1,738a5b24-c2db-d679-2df5-4ec6ff8b5bb9,6d7ec66a-cc7f-31c4-0abe-4eea8c93aa2f,1622f5bd-f50b-0a91-9a34-58dcdbdcb79d,7b09cd0e-70db-7883-8422-70ff1029e0c0,c2ae0925-8c42-5fb8-82af-78dddc28084b,1c0e38ce-ce13-96a1-a9b3-7bb2fcebb22c,1f2ade37-307c-02ec-fc10-9702fa7bcc65,d6962cb8-d0c9-dcf7-9fe2-9bb4306209cd,d592e1bc-da24-f87a-1837-9ce22cb6b20c,2d574ee8-f9d7-2438-62ad-9cf690317c24,3bbbb69b-5f24-a786-f70a-a26cd4677412,63eb69e7-b070-fe73-0bff-b37451826d43,c7884a4b-7f4a-eb57-3203-b3a8415828e5,9b6231f6-c6cf-7ef7-0811-b7b58c26737d,217869da-7fb2-f9db-ef42-c55ec7cc2aa4,5ca4d3b2-f9a9-f4f9-e828-cccc1c4fcbe4,ac394dbd-8adb-baf6-9b23-d21e63769b4c,3570f2da-f98f-8552-9984-57640d172ca3')) )] starting at [, 'contains', '1622f5bd-f50b-0a91-9a34-58dcdbdcb79d,f65a6e70-2a54-9684-c263-0140e09d5adb,6d7ec66a-cc7f-31c4-0abe-4eea8c93aa2f')) || (prompt62.value, 'contains', 'f65a6e70-2a54-9684-c263-0140e09d5adb,709f6ca6-a460-9003-39fd-047ce2dc1bcc,79daa23d-33e4-48b0-d88b-06ad0771d2ad,d1db0588-f159-fc9d-8866-09a8ce9e0ab7,1a8a20d5-01c4-a32d-c440-0b25bcbd0cc3,76f71819-d62b-4b0b-7450-0e371f4ca61a,d09067d6-a825-9220-4da0-20429359e6ef,b9b8f22d-9eb6-0055-1581-478fbe0009f1,738a5b24-c2db-d679-2df5-4ec6ff8b5bb9,6d7ec66a-cc7f-31c4-0abe-4eea8c93aa2f,1622f5bd-f50b-0a91-9a34-58dcdbdcb79d,7b09cd0e-70db-7883-8422-70ff1029e0c0,c2ae0925-8c42-5fb8-82af-78dddc28084b,1c0e38ce-ce13-96a1-a9b3-7bb2fcebb22c,1f2ade37-307c-02ec-fc10-9702fa7bcc65,d6962cb8-d0c9-dcf7-9fe2-9bb4306209cd,d592e1bc-da24-f87a-1837-9ce22cb6b20c,2d574ee8-f9d7-2438-62ad-9cf690317c24,3bbbb69b-5f24-a786-f70a-a26cd4677412,63eb69e7-b070-fe73-0bff-b37451826d43,c7884a4b-7f4a-eb57-3203-b3a8415828e5,9b6231f6-c6cf-7ef7-0811-b7b58c26737d,217869da-7fb2-f9db-ef42-c55ec7cc2aa4,5ca4d3b2-f9a9-f4f9-e828-cccc1c4fcbe4,ac394dbd-8adb-baf6-9b23-d21e63769b4c,3570f2da-f98f-8552-9984-57640d172ca3')) )].
The error says a parenthesis is missing and it is missing '('. However, I don't think the criteria would work even if the parenthesis wasn't missing.
From the error above, this is the div element.
A working single 'contains' criteria is shown below. It calls compareQueryResult().
So 'compareQueryResult' is missing from conditions with a 'contains'. I am no JavaScript expert and would appreciate it very much if RO Toolbox can handle 'contains' conditions. Thanks!
I added code to not call modBoolCriteria if 'contains' is found in the criteria. There should be eight calls to modBoolCriteria. See the picture below for fixing ShowHideCriteria.
A word of caution, I don't know if introduced some other problems. Please test. Thanks.
Autocomplete is working fine, but when you select a user and then clear the field (i.e. because you accidentally selected the wrong user), the first selected user is being remembered. Now if you start typing a different username but this time you forget to select a user from the suggestions, the first (removed) selection will be saved once the form is submitted.
So, if you'd like to reproduce this issue, use autocomplete, select an item, clear the field and type something different without selecting anything this time. Form can be saved even if this field is required because a valid selection was made (the first one which was removed).
Seems like @AutoComplete / @MultiSelect tags are breaking the RO commit in v9.3.10. Can anyone confirm this?
It seems to be tied to the newly(?) introduced roService.js which cannot process the answers, when using the tags.
After a bit more digging, it seems like there multiple issues. First of all, there seems to be a bug i v9.3.10, where String prompts, not mapped to a WI property (ie used as a Token in query prompt), is not handled correctly, which cause
Furthermore, there's now a new way that the portal handles query prompts with a new input element, where it stores a JSON representation of the selected items (instead of reading only the selected item ids), so it seems to be necessary to (in both
createAutoComplete
andcreateMultiSelect
functions):Add
Id
andClassTypeId
to whatpreprocess
returns, ie:Change from
select
tochange
in thekendoAutoComplete
constructor.Replace everything in the
change
function ofkendoAutoComplete
andkendoMultiSelect
constructors with the following (which is blatantly stolen from app.controls.js):And lastly, to fix the bug in roService.js, you can add
if(source.Targets == null) continue;
right aftervar source = sources[i];
in the processNoneMapping function (note: Editing files outside of CustomSpace is completely unsupported by Cireson).Or wait for Cireson to release an official hotfix (issue is reported).
We have tried this solution but im getting
Its becoming a real issue as we cannot update our portal from 9.3.4 we are using the rotoolbox in alot of our forms and it would take alot of work and be unpractical to revert all those forms to the old queryprompts.
Hi Magnus,
Can you test with the most recent code from github?
https://github.com/doyle-johnpaul/ROToolbox
Thanks John i will try during the holidays.
We have some custom functions we have added ourself, i will try and merge these with the new version and share them with the community, i havent used Git but i´m learning :)
Hi!
Think i found a issue with @DatePicker {"DateOnly":true}.
When i use it, it only shows the date, but when i go to next field, the date shown in the date field contains the time..
eg: 2020-02-28 00:00
Ping @john_doyle
Hi @john_doyle
I made a pull request on the GitHub with a minor addition.
I added some functionality to underline the text in the autocomplete box when an object is selected and if you click out of the autocomplete and there is exactly one match for the filtering string it will select that item and underline it to show a selection was made.
This matches the functionality elsewhere on the portal such as editing/creating a Work Item.
Let me know what you think.
James
I am having issues with the placeholder text on a @MultiSelect
It works fine when the multiselect field is set to "Show Always" however when it is only shown when another condition is met (like a dropdown list having a specific value) the placeholder text does not display until you click in the field / click back out of the field.
Is anyone able to help out with this?
Thanks
Hey @john_doyle / anyone else that may be able to help me out here,
What started out with a few intermittent issues with @ShowHideCriteria and the more and more I seem to have looked in to it the worse it is getting and the more confused I am....
Every now and then I have PowerShell scripts that run through several different SRs logged from different ROs that are failing as the user input is either missing what should be a required field or have additional user input in them that shouldn't be possible to be there ..
Alot of the time I have been unable to replicate the issue but having a look in to it now I seem to be able to consistantly 50% of the time atleast replicate what is going on. When the @ShowHideCriteria is used across 2 Simple Lists, it doesn't always behave as expected.
The ROs this was running on was quite complex and we have over 100 JavaScript scripts loading on the portal so I decided to disable all scripts except the ROToolbox and also create a very basic request offering.Doing so however, has actually made the issue worse and pretty much happening every time now ...
However, when going in to the RO this kind of stuff happens :
Or this :
Or even this :
It seems that if you pick the correct criteria to start with to show the field (Yes / No) it works fine. Or if you play around with the simple lists you can get it to behave again... I checked in the dev tools and the element is always set up as follows :
I've tried to troubleshoot the ROToolbox with no luck .... Can someone please try and help out with this?
Running version 9.3.4 of the portal if that help.
Thanks :)
Hi everybody,
Does anybody have an example on how to create an enum picker / kendoExtDropDownTreeViewV2? I want to create a new picker and write the selection to a text prompt.
Background:
I'm in an situation, where I need the functionality to map an enum to a text field (description in my case), which is currently not possible with ARO, because it needs the actual enum list property to map it to. There's a year-old request for it here: https://community.cireson.com/discussion/5047/update-the-mp-enumeration-list-prompt-type-in-aro-to-allow-mapping-to-a-standard-text-field but it's not addressed by Cireson yet (go vote!).
So I'm thinking I'll add it to the toolbox, sorta like QueryList, but mapping it to a text prompt instead of changing the dataSource of a simple list. The reason for this is that the Simple List does not have filtering enabled, and even if you were to enable filtering (
kendoDropDownList({filter: "contains"})
), you'll break the element, as Cireson's blur-function closes the dropdown on blur, making it impossible to select the "filter" box.But I'm not sure on how exactly I need to initialize the new enum picker / kendoExtDropDownTreeViewV2 control, so if anyone has an example, that would be great!
Hi @Konstantin_Slavin-Bo ,
This is how we do it.
Get the id of your enumeration list.
You can get this through PowerShell : Get-SCSMEnumeration -Name 'NAME OF YOUR ENUMERATION LIST' | fl id
On the portal in Admin Settings - Dashboard Query Settings create a new query.
SELECT ServiceManager.dbo.LocalizedText.LTValue
FROM ServiceManager.dbo.EnumType INNER JOIN
ServiceManager.dbo.LocalizedText ON ServiceManager.dbo.EnumType.EnumTypeId = ServiceManager.dbo.LocalizedText.LTStringId
WHERE (ServiceManager.dbo.LocalizedText.LanguageCode = 'ENU') AND (ServiceManager.dbo.LocalizedText.LTStringType = 1) AND (ServiceManager.dbo.EnumType.Enabled = 1) AND (ParentEnumTypeId = 'ID OF YOUR ENUMERATION LIST')
Note down the ID of your Dashboard Query.
In the ARO create a Display Only text field with the following in it
@QueryList {"QueryId":"ID OF YOUR DASHBOARD QUERY","Sort":"DisplayString","Item":"DisplayString","Value":"DisplayString"}
Below that field create an optional or required Simple List.
When configuring the list, just click OK to create a blank list.
That should do the trick :)
While I'm here - can anyone help with my 2 queries above? Issue with the placeholder in the @Multiselect and the much bigger issue of inconsistant @ShowHideCriteria results ..
Hey @Ryan_Kennedy1, thanks for your suggestion!
Unfortunately, I do not want to use a simple list, because it doesn't have filtering enabled (see my post for details), so I was hoping, that someone had an example of how to create the
kendoExtDropDownTreeViewV2
element, so I could manually create that in the toolbox, and bind the result to a text prompt.And we don't use the
@ShowHideCriteria
tag at all, as I find that recompiling angular is not stable in all browsers, so I've removed all code relating to those in our clone of the toolbox. So I can't really help you there, sorry.Hey @Konstantin_Slavin-Bo , sorry about that ... Reading back through your post it seems I really didn't read It to start with ... It was quite early in the morning here! I think I just saw the words 'enum picker' and went from there .. Unable to help sorry but i up voted the feature request for you!
Here you go, make sure you are within an Incident for the jQuery html append to work before you paste the code in the console window!
This will create and enum tree picker from the Incident tier queue below the Escalated property in the workitem form but works with any enum list and anywhere youd like to inject it:
@Martin_Blomgren
Do'h... Thanks for that! I somehow completely forgot that I already use a enum picker for my Transfer task, so I already had the code for that 😑
Thanks a lot!
Oh, and welcome back! Haven't seen you around for a long time.
I am trying to follow the instruction provided by this thread but I am not able to make the search or autocomplete work. Any help would be greatly appreciated. I downloaded custom_ROToolbox.js custom.js custom_ROAutocomplete.js and copied them to the CustomSpace folder.