AnsweredAssumed Answered

Filtering report with scripting

Question asked by tjvalenza on Nov 3, 2017
Latest reply on Nov 4, 2017 by philmodjunk

I'm a newbie with limited database experience but with enough reading and puttsing around I've been able to work through (brute force) a proof of concept for my companies project database.  My current solution has a main project table with several related tables such as "Project Status" and "Proposal Status".  I'm trying to create a report that only prints out projects that the "Proposal Status" is set to "Awarded to Company".  I've use the following link as a guide to set the scripting:

 

Scripted Find Examples

 

My script is as follows:

 

     Go To Layout ["Report"(Project Information);Animation:None]

     Enter Find Mode []

     Set Variable [$$ProposalStatus; Value: "Awarded to Company"]

     Set Field [YourTable::YourField ; "==" & $$ProposalStatus]

     Set Error Capture [on]

     Perform Find []

     If [Not Get ( FoundCount ) // no records were found ]

         Show Custom Dialog ["No records were found by this search."]

     End IF

 

The other proposal status are the following:

     Canceled

     On hold

     Awarded to competitor

     Open

 

The problem that I found and the issue that I have is that the script isn't working with the Value: "Awarded to Company" It appears that it is because of the spaces in between the words.  I've switched it with Canceled and Open and it works but it doesn't filter for On hold or Awarded to competitor.  From what I have read and have used in other instances I thought that whatever is in between the quotes "" it will use even if there is a space.  I know some times spaces are not accepted but I thought the quotes allowed it.

 

Is this my issue or is it something else?  Is there something else I can do so that I can still use my current lists? 

 

Thanks in advance!

Tony

Outcomes