BowDown Posted January 14, 2008 Posted January 14, 2008 Here's what I have: Field Named: sbtDocs Field has 3 repetitions Calculation result is a Container There are 3 blocks on my Layout that show repetitions 1-3. For the field calcuation I have: If( not IsEmpty(orders::sbtSONO); Case( Get(CalculationRepetitionNumber) = 1; "filewin://srs3/Order Documents/SBT/" & Trim(orders::sbtSONO) & "C.pdf"; Get(CalculationRepetitionNumber) = 2; "filewin://srs3/Order Documents/SBT/" & Trim(orders::sbtSONO) & "I.pdf"; Get(CalculationRepetitionNumber) = 3; "filewin://srs3/Order Documents/SBT/" & Trim(orders::sbtSONO) & "P.pdf"; ) ; "" ) What I'm trying to do is check to make sure the order has an SBT Number before anything else. If it does I want to populate the 3 blocks with different filepaths to 3 different pdf files. They all share the same path except the letter before the extension. It will display the first repetition correctly, but the remaining 2 repetitions are left blank. Like it's not calculating them. What have I done wrong?
BowDown Posted January 14, 2008 Author Posted January 14, 2008 If( not IsEmpty(orders::sbtSONO); "filewin://srs3/Order Documents/SBT/" & Trim(orders::sbtSONO) & Case( Get(CalculationRepetitionNumber) = 1; "C.pdf"; Get(CalculationRepetitionNumber) = 2; "I.pdf"; Get(CalculationRepetitionNumber) = 3; "P.pdf"; ) ; "" ) Another flavor, but it still doesn't work. Weird thing is if I put "Get(CalculationRepetitionNumber)" in the else statement it will print out the Rep# in the 2nd and 3rd block? Why can't the 2nd and 3rd rep pass the If statement?
comment Posted January 14, 2008 Posted January 14, 2008 You need to enclose any reference to a non-repeating field (orders::sbtSONO, in your example) within the Extend() function.
BowDown Posted January 14, 2008 Author Posted January 14, 2008 That worked! Thanks alot!! Is there any way for filemaker to check to see if the file exists before linking it?
comment Posted January 14, 2008 Posted January 14, 2008 Not really: http://www.fmforums.com/forum/showtopic.php?tid/183503/ Anyway, what would be the point?
BowDown Posted January 14, 2008 Author Posted January 14, 2008 That plug-in did the trick. Thanks again!
BowDown Posted January 14, 2008 Author Posted January 14, 2008 The point was to keep bogus shortcuts from being created on my forms. Otherwise filemaker would blindly create 3 links to files that might not exist.
Recommended Posts
This topic is 6504 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now