1 Reply Latest reply on Apr 13, 2011 9:43 AM by philmodjunk

    Custom Finds



      Custom Finds


      I'm currently working on a large project for a client and assisting the marketing department with setting sales focus.

      The marketing director will have a table which he can set a start date and end date for his marketing team so when the team opens up the list of clients to target it will automatically do a find and show those relating to the sales target information based on the current date. I basically need to take a table of data and instead of importing it into browse mode, i need it imported into find mode!

      For example

      The marketing director logs on, sets his target table to say for the next month i want you guys to focus on NSW clients who are active (the actual use is based on about 10 different fields), HOWEVER there are going to be over lapping/multiple targets, which is why i'm using a seperate table. Is there an easy way to manipulate

      So far i've come up with the following ideas

      - Use a large amount of looped variables (yucky)

      - Have FM open a second window and flick between the 2 windows, one in find mode and one in browse mode and it will flick between the 2 as it fills in the finds

      Anyone have any more simple ideas?

      Thanks in advance for any ideas put forth!


      Just to let anyone know if this post is stumbled across, i solved it with a loop that fills up a repeating global field, as long as the number of repititions are greater than the number of searches then it works fine :)

        • 1. Re: Custom Finds

          No need for any global field, let alone a repeating one.

          Let's say your table of search criteria used by your Marketing Director is called "Targets" and has the following fields defined in it:

          TargetDate, StartDate, EndDate, Region //add as many fields as needed here

          Your Script can run like this:

          #find most recent TargetRecord not dated for the future.
          Go To Layout [Targets]
          enter find mode []
          Set Field [Targets::TargetDate ; "<" & get ( CurrentDate ) ]
          Set Error Capture [on]
          Perform Find[]
          IF [ Get ( FoundCount ) > 0 ]
             #Find records to match target criteria
             Sort [No dialog ; restore ] // sort by target date in descending order
             go To Record/Request/Page [first]
             Set Variable [$DateRange ; value: Target::StartDate & "..." & Target::EndDate ]
             Set Variable [$Region ; value: Target::Region ]
             Go To Layout [Clients]
             Enter Find Mode []
             Set Field [Clients::Date ; $DateRange]
             Set Field [Clients::Region ; $Region]
             Perform Find[]
          End IF

          That's just a basic outline. Much more sophisticated finds can be performed using this basic technique.