1 Reply Latest reply on Oct 22, 2015 2:12 PM by siplus

    Get found Count

    thong127

      Hello,

       

      Can you please help me improve with my script below:

       

      First Set of Script:

       

      Allow User Abort [off]

      Show Custom Dialog ["View or Save"; Do you want to View Only or Save as Excel?

      If Get [(LastMessageChoice)] = 3

            Go to Layout[original layout]

            Exit script

      End If

      [ 1 = VIEW, 2 = SAVE, 3 = CANCEL ]

       

      If [ Get ( ScriptParameter ) = "API" ]

        Perform Script [ API ]

      Else If [ Get ( ScriptParameter ) = "Bottles" ]

        Perform Script [ Bottles ]

      Else If [ Get ( ScriptParameter ) = "Capsules" ]

        Perform Script [ Capsules ]

      Etc….

       

       

      Second Set

       

      Enter Find Mode[]

      New Record/Request

      Set Field [Materials::Material Category; "API"]

      Omit Record

       

      New Record/Request

      Set Field [Materials::Material Category; "Closure"]

      Omit Record

       

      New Record/Request

      Set Field [Materials::Material Category; "Bottle"]

      Omit Record

       

      New Record/Request

      Set Field [Materials::Material Remarks; "Rejected"]

      Omit Record

       

      New Record/Request

      Set Field [Materials::Material Balance; "0"]

      Omit Record

       

      Perform Find []

       

      If [Get(FoundCount) = 0]

      Show Custom Dialog ["Others" ; "Sorry No Record Found".]

      Go to Layout [original layout]

      End If

       

      I want to put like if the found count is zero (0) if will replace the filemaker default "no record match in this criteria" so I add the last 4 lines on my second set of script but Its not functioning as I expected.

       

      Thank you so much.

        • 1. Re: Get found Count
          siplus

          I want to put like if the found count is zero (0) if will replace the filemaker default "no record match in this criteria" so I add the last 4 lines on my second set of script but Its not functioning as I expected.

           

          Thank you so much.

           

           

          Set Error Capture [on]

           

          ... do your find ...

           

          If (Get(LastError)

          .... your message