Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Graphic Rules

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old March 15th, 2019, 11:51 AM
geeool geeool is offline
Junior Community Member
 
Join Date: Jun 2012
Posts: 13
Default If the Resource doesn't exist...

Hi,

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.


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

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:46 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.