3 Replies Latest reply on Mar 31, 2015 9:02 AM by philmodjunk

    Need Trigger A Script while Pick A Module

    Suresh

      Title

      Need Trigger A Script while Pick A Module

      Post

      Hi Admins & Experts,

      Here I make a Report it has a inbuilt default script. In this i just need to change as when I click the 'Report' Layout on that It should need to display yet today details of the date field.

      For Ex:
      Start Date: Jan 2, 2015
      Completion Date: Mar 25, 2015
      Start Date: Jan 15, 2015
      Completion Date: Mar 29, 2015
      Start Date: Feb 12, 2015
      Completion Date: Apr 2, 2015
      Start Date: Feb 23, 2015
      Completion Date: Mar 28, 2015


      In here, while I pick the Report Layout, it should display as,
      #__Start Date__Completion Date
      1__Jan 2, 2015__Mar 25, 2015
      2__Jan 15, 2015__Mar 29, 2015
      3__Feb 23, 2015__Mar 28, 2015

      So Actually I need what the record has till today date value that should need to display in Report Layout!!

      My Script is,

      Enter Browse Mode[]
      Go to Layout ["Report"]
      If[Table1::Completion Date <= Get( CurrentDate )]
      Sort Records[Restore; No dialog]
      Else
      Omit Record
      End If

      Was this script is correct? Or Actually this script need to be Triggered automatically whether I pick the Report Layout! It works very very few times only. i.e. when I click morethan 5 times only it works!! So only these much confusions!!

      Help to do this better !!!

      Thanks,
      Suresh

        • 1. Re: Need Trigger A Script while Pick A Module
          mchancevet@gmail.com

           

          If I understand correctly there are two issues.

                 
          1. The layout does not present the data correctly
          2.      
          3. You are not getting the correct set of records in your report.

          If I am mistaken about the purpose of the script sorry to waste your time. I may have some suggestions for you to consider.

          1. - Try a list view,  in layout mode, place the three fields (without labels) (#, Start Date, Completion Date)  in the body. make the body height only as big as you need for the three fields. Place headings (labels) above them in the header (or in a sub summary part if you are going to sort by the same field as that sub summary part)

          2.

          Script 

          Set Variable [$Date: Value{Get (CurrentDate)}

          Go to layout [Report]

          Perform find [ FInd; Table1::Completion Date < $Date]

          Sort Records

           

          The 'perform find' step is defined via some dialogues. If you need help with this repost for help.

          Best regards,

          Morgan

          • 2. Re: Need Trigger A Script while Pick A Module
            Suresh

            Dear Morgan,
            This is what I expected!! smiley Your script make it best.. Thanks laugh Thanks a lot!!!  

            • 3. Re: Need Trigger A Script while Pick A Module
              philmodjunk

              There is, in my opinion, a better way to set up a scripted find. Nothing intrinsically wrong with used stored find criteria, it's just that this option is not as flexible--you can't calculate a value while setting up the criteria and it hides these details such that you have to open two additional dialogs to see all of those details.

              An alternative approach for specifying find criteria is illustrated here: Scripted Find Examples