View Single Post
Old March 15th, 2019, 11:51 AM
geeool geeool is offline
Junior Community Member
Join Date: Jun 2012
Location: Hilliard, OH
Posts: 15
Default If the Resource doesn't exist...


This is for an online product. I'm using FusionPro Creator 10.0.6 on Windows.

I am programming tags for people to customize and order online through a MarcomCentral site. There are 100 or so different tag backgrounds that are being called in based on the SKU number the buyer enters. I have these backgrounds setup as resources and they are named with the SKU number (for example: 356304.pdf).

If the SKU number entered doesn't match one of the resources, then I want it to return error.pdf instead. My rule works fine if the resource is present, but it doesn't return the error.pdf if the resource is missing. Below is the code. Any suggestions would be appreciated.

var tagImage = Resource(Field("SKU") + ".pdf", "graphic", true);

if (tagImage.exists) { 
    return tagImage;
else    {
    return Resource("error.pdf");
Reply With Quote