ReminderVDP Posted June 5, 2013 Share Posted June 5, 2013 I am trying to create some type of warning that will search the folder that contains all of our images and text for a job and will put a red box for a missing image or red type for missing text. I know I could convert every rule to Javascript and then add the image or text error resource I create in each rule individually. I guess I'm trying to see if there is a way that you could write a rule in OnRecordStart to cover every field and rule if the resource is missing from a particular folder? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 5, 2013 Share Posted June 5, 2013 I guess I would need to know more about exactly what conditions you're trying to test for. When you say, "missing text," do you mean just that a field value is empty? If so, what exactly would you show in red? In what other way would text be "missing" that you could show it in a different color? As for graphics, if you have a rule that's returning NullResource(), you could have it return a specific graphic that shows something like a red circle with a line through it. You can certainly change the border on a graphic frame, but there isn't necessarily a one-to-one correspondence between graphic resources of rules and graphic frames. In other words, you might use a graphic in more than one frame. Quote Link to comment Share on other sites More sharing options...
ReminderVDP Posted June 5, 2013 Author Share Posted June 5, 2013 (edited) I mean the file is not on the folder on the server that contains all the text files. The file is listed in the data but the actual .txt file can't be found where the file path is pointing. We have over 234 possible data fields and we need to know if something is missing in our test data prints before we run all 80,000 records. A rule would need to pull the "error" resource I would create if the file is missing, rather than the field being empty in the data. Edited June 7, 2013 by ReminderVDP Quote Link to comment Share on other sites More sharing options...
ReminderVDP Posted June 20, 2013 Author Share Posted June 20, 2013 Dan, The only issue I have had with replacing NullResource(); with the name of the Resource I used, Resource("MissingImage"), is that it will place that missing image if the field is empty. I just want it to place the Resource("MissingImage") if the file is missing from the server. I can't get an if/else statement to work for what I need. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 20, 2013 Share Posted June 20, 2013 Oh, I see: when you say, "missing text," you mean a missing text resource file. You can just call the .exists property of any FusionProResource object (returned from the Resource or CreateResource function). You can do something like this for text: var resource = Resource("YourTextResourceName"); if (resource.exists) return resource; //else return '<color name="red">Resource not found!</color>';Or, for graphics: var resource = Resource("YourGraphicResourceName"); if (resource.exists) return resource; //else return Resource("MissingImage"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.