7 Replies Latest reply on Jul 25, 2016 6:18 PM by RickWhitelaw

    Custom Dialog Box Listing different data found from scripts

    Jtmwalk

      I am trying to find the best way to show in a list type format, multiple data returns from several different script parameters.

       

      I have set up a "delete this record" button for the user.  Several different fields must be checked via script criteria to verify these fields are empty of data before the specific record can be deleted.

      I have identified the criteria to verify each field with a Case Function Script, and this will return the values to be corrected, however: I cannot get them to appear on the Custom Dialog screen for the user to review and care for.  I ONLY want the field names to show that do NOT meet the script criteria, be it one, many or none of the fields needing attention at run time.  Currently, I can get one result to display, and only after correcting that one specific item and re-running the script it will show the 2nd field and so on.  This is what I am attempting to accomplish and display in the Message area of Custom Dialog Box

      "This record cannot be deleted for one or more of the following reasons :"

      &"¶¶"&

      "          Customer Invoiced"&"¶"&               ←This would only show if field has data

      "          Revenue $"&"¶"&                             ←This field would NOT show if field is already empty

      "          Driver Assigned to Moves"&"¶"&   This would only show if field has data

      "          Cost Incurred"                                  This would only show if field has data

      &"¶¶"&

      "See Administrator to Delete"

       

      IF after checking individual script steps for each field, I only want results to return on items that need attention, and not the fields that are cleared through the script steps as okay.

       

      This HAS to be so basic, but I am unable to find the answers in the forum discussions.  Could someone please point in a direction to find the solution to this?  Thank you in advance for your help.

        • 1. Re: Custom Dialog Box Listing different data found from scripts
          bigtom

          So you want a dialog with a list of all failed after the full script is run, or a one at a time notice for each failure.

           

          This is controlled through your script. Check for all conditions and then show dialog only if the condition is not met. If you need a list at the end you can add each exception to  list variable and show it at the end. I would advise flagging the records and displaying them in a popover portal so the user can have a persisting list of the failures. Maybe storing keys in global variable is the answer.

           

          A few ways to do this but depends on the rest of your script and what you want exactly.

          • 2. Re: Custom Dialog Box Listing different data found from scripts
            user19752

            List ( <<fields list here>> )

            lists up field values with return delimited, only fields that have value.

            • 3. Re: Custom Dialog Box Listing different data found from scripts
              philmodjunk

              I would not use a custom dialog for this. I'd open a new window to an adaptive layout where I can show or hide editable fields as needed. Not only can you use hide conditions but you can also use a slide control where each panel has a different combination with code in your script that selects the appropriate panel.

              • 4. Re: Custom Dialog Box Listing different data found from scripts
                Jtmwalk

                This was so simple and almost exactly what I am looking for, thank you!

                I just need a little more detailed help refining what/how data displays.

                 

                Here is the script to check field qualifying status.  If any of the script steps return a value >0, then those are the only field results that I would like to have show in the message box.  How can I eliminate the fields that =0 and fail the script parameter not to show in the message box?

                 

                List (

                Sum Total Original Invoice>0; "Revenue Asigned";

                Trip Sheets::Ssum of Total Dvr>0; "Driver $$ Applied";

                Trip Sheets::Count Dvr #>0; "Driver Assigned to Move";

                Trip Sheets::Count Dvr Line date Moves>0; "Move Date Assigned")

                This produces in the Custom Dialog box:

                Thank you again for helping with a basic simple solution!

                • 5. Re: Custom Dialog Box Listing different data found from scripts
                  philmodjunk

                  Which is why I wouldn't use a custom dialog. I briefly outlined several options in my previous post. None would use show custom dialog. They do assume that you want the user to edit them once they are displayed. There are simpler options if you want to set up a read only display of fields and values.

                   

                  1. Set up a layout with all of these fields and their labels. Use hide object when to make a field and its label disappear when the field's value is zero. This is simple but there's no way to close up a gap created by hiding a field.

                   

                  2. Set up a slide control with "dots" removed but with multiple panels - each with an object name and each with a different group of fields. This is really only practical for a small number of fields as the number of fields and the if steps used to select a particular panel will grow rapidly as the number fields increases.

                   

                  3. An option that I haven't mentioned before is to simply use conditional formatting to change a field's color to draw attention to the fact that the field is in need of editing.

                   

                  Sent from my iPhone

                  • 6. Re: Custom Dialog Box Listing different data found from scripts
                    user19752

                    You need Case() function for each item,

                     

                    List (

                    Case ( Sum Total Original Invoice>0; "Revenue Asigned" ) ;

                    Case ( Trip Sheets::Ssum of Total Dvr>0; "Driver $$ Applied" );

                    Case ( Trip Sheets::Count Dvr #>0; "Driver Assigned to Move" );

                    Case ( Trip Sheets::Count Dvr Line date Moves>0; "Move Date Assigned")

                    )

                    • 7. Re: Custom Dialog Box Listing different data found from scripts
                      RickWhitelaw

                      Nice to read your contributions one again Phil.