8 Replies Latest reply on Nov 28, 2016 1:10 PM by dcogny

    how to filter picklists?

    Apprentice

      Hi,

       

      is it possible to filter a picklist used in the prompt function?

       

      I want to achieve the following purpose:

      I have implemented a request offering. using a Task block. This Task block can be completed by clicking a button in the Task grid of the Service request Workspace.

      If you click this button a quick Action will be run. Within this quick Action there is a prompt function using a picklist. The user can choose one of the given Options.

      The choosed Option will be saved in a custom field of the Service request and the workflow of the request offering will continue.

      The following block in this workflow is a Switch. This Switch uses the value of the custom field to decide which way of the workflow will be used.

      The Problem is, that there could be an Option in the picklist which is not supported by older workflow versions.

      Therefore I want to filter the picklist by the workflow Version.

      My Picklist:

      No     option     workflowVersion

      1        xxx          1

      2        yyy          1

      3        aaa          13

       

      The challenge is to present only Option "xxx" and "yyy" in all Service requests using workflow Version 1 to 12 and present Option "xxx", "yyy" and "aaa" in all Service requests using workflow Version greater than 13.

       

      I hope that anybody can help me.

       

      best regards

      Björn

        • 1. Re: how to filter picklists?
          dcogny Expert

          Hi,

           

          This is how I would do it, but is pure theory:

          I imagine that you already have a "workflowVersion" field on your Service Requests,

          • Push that field to your Task (Using the Relationship or a Business Rule; ask if you need clarification on this)
          • Create the pick list and create a constrain where you compare the "workflowVersion" of your "option" versus the one you added from the Service Request (Not sure on how you save the version of the option, I created a OptionWFVersion field as an example):

           

          Capture.PNG

           

          Don't hesitate asking if the instructions are not clear enough.

           

          Daniel.

          • 2. Re: how to filter picklists?
            Apprentice

            Hi Daniel,

            thank you very much for your answer.

            I think my Problem is much more difficult in the backend or I did anything wrong. But you brought me on an idea.

             

            I have created a "pure Validation object" called "SRClassification". I use this BO in the picklist "Type of SRClassification".

            If the user clicks the button in the Task grid a "run for child quick Action" will be invoked which runs the prompt function using the picklist "Type of SRClassification".

            The  choosed Option will be stored in the custom field of the Service request.

            I have added a contstraint in my picklist with the prefix [ValidationList] and actual a comparison with the SRNumber because I have not the workflow Version in my SR by now.

            When i click the button "Executing ... Classification" the popup appears with the configured picklist "Type of SRClassification"

            If I want to open the drop down list I get the following error:

            Do you have an idea?

             

            best regards

            Björn

            • 3. Re: how to filter picklists?
              dcogny Expert

              Hi Björn,

               

              I'm not completely sure, but if I got it right the problem is that there is not a [ValidationList]ServiceReqNumber anywhere, so the constrain cannot work, as you see on your screenshot you are only asking for the category. for a constrain to work, the "condition" PickList must be selected in the current form where you are trying to use it (a form, a prompt...). 

              Also keep  in mind that the [ValidationList] constrain implies a PickList, so you have to create a PickList called "ServiceReqNumber", choose from it and then the constrain will work.

               

              And I think that I don't have all the information yet, please answer:

              • Who and how decide which is the workflow version and where is that information saved? (i.e. all Service Requests under 100000 are version 1, all between 100001 and 150000 are version 2... or there is a flag that gets updated every time there is a new workflow...)
              • Where are you storing which Workflows are available for each workflow version? (How do you know that "aaa" should be only available to "workflowVersion 13")

               

              If you can fill me this gaps, or even better a full description of what you have in place right now, I am pretty sure that we can get somewhere, I don't see it unfeasible.

               

              Daniel.

              • 4. Re: how to filter picklists?
                Apprentice

                Hi Daniel,

                 

                regarding "there is not a [ValidationList]ServiceReqNumber anywhere":

                -> see http://help.heatsoftware.com/#reference/expressions/field_references.htm#Referencing

                If I understand the Manual correctly, it is possible to reference a field in the constraint of an other Business object.

                In my case: I compare SRClassification.minSRWFVersion with ServiceRequest.ServiceReqNumber

                 

                I think, I don't understand you correctly:

                as you see on your screenshot you are only asking for the category. for a constrain to work, the "condition" PickList must be selected in the current form where you are trying to use it (a form, a prompt...). 

                Also keep  in mind that the [ValidationList] constrain implies a PickList, so you have to create a PickList called "ServiceReqNumber", choose from it and then the constrain will work.

                Who and how decide which is the workflow version and where is that information saved? (i.e. all Service Requests under 100000 are version 1, all between 100001 and 150000 are version 2... or there is a flag that gets updated every time there is a new workflow...)

                My first thougt was to add a custom field in BO "ServiceRequest" and store in this field the used workflow Version. But this seems to be very tricky, so I decided to use the ServiceReqNumber instead: all Service Requests under 100000 are version 1, all between 100001 and 150000 are version 2...

                Acutally I do only prototyping. Therefore the field "workflowVersion" in the picklist means: Enable an option only if the ServiceReqNumber of the current SR is greater than "workflowVersion".

                 

                Where are you storing which Workflows are available for each workflow version? (How do you know that "aaa" should be only available to "workflowVersion 13")

                The purpose is to Support the following workflow part:

                The above screenshot is part of my request offering. The workflow creates the Task "KinA Klassifzierung". Thereupon the user accept this Tasks and click the Button "Executing .. Classification". After that the prompt appears and the user choose one of the possible Options. The result will be stored in the custom SR field "WF Model" and is the baseline of the following Switch-block:

                In dependency to the choosen Option, the workflow chooses the next steps of the request offering workflow.

                To provide choosing a not supported Option I have to filter the popup depending of the used workflow Version.

                 

                An example "I have to extend the above Switch-block by adding the Option "ttt"":

                - I edit the request offering workflow. Implement the requested Option "ttt" and the necessary workflow blocks

                - I extend the picklist "Type of KinA Classification" with a new entry "No:4; Option:ttt; workflowVersion: 5000" (if 5000 is the max ServiceReqNumber before Publishing the new RO)

                => So, If the user opens a SR (SRNumber less than 5000), the new Option will not be visible. If the user opens a SR (SRNumber greater than 5000), the user can choose Option "ttt".

                 

                I hope you can help me finding a solution.

                 

                thanks in advance

                Björn

                • 5. Re: how to filter picklists?
                  dcogny Expert

                  Let me look into it, now I have a better idea of what you want, I will have something for you (but today I spent too much in the forums... )

                  • 6. Re: how to filter picklists?
                    dcogny Expert

                    Hi Bjorn,

                    This has being a tricky one!

                    I got it working... but I don't know why it only works once   I'm telling you what have I done, maybe you don't have the same issue... or you figure out the problem!

                     

                      • Create a field in the "SRClassification" object to store the ServiceReqNumber
                      • Create a Relationship between "Task" and "SRClassification" (One "Task" to many "SRClassification") and store the "ParentObjectDisplayID from the Task into the field created in the previous step

                    Relationship.png

                      • Add the constraint to the PickList

                    Pick.png

                      • Then create a "Composite Action for the Task:
                        1. Search and Link All the SRClassification
                          1.png
                        2. Store the "workflowVersion" on your Task (Remember "Quantities" would be the name of your PickList)
                          2.png
                        3. Search and Unlink all the SRClassification
                          3.png
                        4. Then Update the Service Request with the proper "versionWorkflow"
                          4.png

                     

                    As said I managed to get it working once, but then it stopped showing anything on the PickList, not sure what is the issue... But maybe it's something unrelated and it works for you... I mean, if it worked once it should work always!

                     

                    Let me know if it works for you.

                     

                    Daniel.

                    • 7. Re: how to filter picklists?
                      Apprentice

                      Hi Daniel,

                      thank you very much. I have tried your Suggestion, but Unfortunately I get another error, when I try to open the preview within the picklist.

                      Which HEAT Version are you using? I use 2016.1 on premise.

                       

                      I think it's a nice trick to link and unlink all picklist entries to the Task and do filtering afterwards.

                      In my opinion this linking and unlinking can be avoided by using the [ValidationList] referencetype:

                      But both Solutions run into an error :-(.

                       

                      I think I Need to create an incident on that error.

                       

                      Thank you very much for your help.

                      Björn

                      • 8. Re: how to filter picklists?
                        dcogny Expert

                        Hi Björn,

                         

                        You might want to check "Issue and Resolution #13011" on the heatsoftware.com Knowledge Base... I think it might work for you with just a few tweaks; the article includes screenshots, but short story:

                         

                        Resolution:

                        This is a known issue for early HEAT Service Management versions. The issue is fixed in Heat 2014.2.1 and the Prompt works as expected. The Pick List should be configured as follows:

                        If the prompt is running e.g. on the "Category" field (which is constrained on the "Service") then the constraint will only work if in the Quick Action the value of the constrained field "Service" is assigned to the "Service field in the Quick Action" before the prompt.

                        -> Service = $(Service)

                        -> Category = $(Prompt("Select Category",  "Category of Category used in Incident"))

                         

                        Daniel.