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


Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old March 15th, 2019, 12:51 PM
geeool geeool is offline
Junior Community Member
Join Date: Jun 2012
Location: Hilliard, OH
Posts: 17
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

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 02:26 PM.

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