Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Getting Started, Learning, Etc.

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 18th, 2019, 01:40 PM
geeool geeool is offline
Junior Community Member
 
Join Date: Jun 2012
Location: Hilliard, OH
Posts: 22
Default Abort Composition

I know this should go under the MarcomCentral area, but I put in a request to join a couple weeks ago and haven't been granted access yet - my apologies for posting here.

In a MarcomCentral site I have price tags setup as a variable item. The buyer enters their pricing information as well as the product SKU number. The SKU number is checked against an external data file. If it exists, then FusionPro pulls in PDF art for that specific tag. If it doesn't exist, it pulls in an error page with the word 'ERROR' written in big red text. The problem is that buyers are still placing orders for tags that do not exist.

I did a little research and found the FusionPro.Composition.Abort() function and added it to my programming. It works wonderful and prevents buyers from ordering tags that don't exist. My only issue is that I would like to customize the error message and so far I haven't been able to. Below is the code I'm using. Is it formatted correctly? Is there away to return a custom error message?

FusionPro.Composition.Abort(["Please check and make sure the Item Number was entered correctly." , false]);
Reply With Quote
  #2  
Old November 18th, 2019, 03:25 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,502
Default Re: Abort Composition

Quote:
Originally Posted by geeool View Post
I know this should go under the MarcomCentral area, but I put in a request to join a couple weeks ago and haven't been granted access yet - my apologies for posting here.
I just added you to the MarcomCentral group.
Quote:
Originally Posted by geeool View Post
If it doesn't exist, it pulls in an error page with the word 'ERROR' written in big red text.
Okay, great. I assume you're doing this in OnRecordStart. This is already part way to what you ultimately want to accomplish, in that you already have a mechanism to show the user of MarcomCentral an error message, on the output Preview.
Quote:
Originally Posted by geeool View Post
My only issue is that I would like to customize the error message and so far I haven't been able to. Below is the code I'm using. Is it formatted correctly?
Yes, and in fact, I think you have been customizing the error message. But it seems that you're confused about exactly where the error message appears.
The message actually gets written to the composition log (.msg) file. Unfortunately, the MarcomCentral application doesn't make it easy to find the .msg file. The way to find it is to open the Preview PDF in a new browser window, copy the URL, change the .pdf extension at the end of the URL to .msg, then copy that new URL into a new browser window's address bar.
Quote:
Originally Posted by geeool View Post
Is there away to return a custom error message?
So when you say "return" here, I think what you're really asking is, "Is there a way to display the custom error message to the end user of the MarcomCentral application?" The answer to that is Yes, and you have already figured out part of it, in that you're showing the user the word "ERROR" in big red text. So what you want to do instead is change that word "ERROR" to a variable (with a name like "ErrorMessage"), then, in the code that's activating that page, you also want to set the value of that variable to your custom error message, something like this:
Code:
FusionPro.Composition.AddVariable("ErrorMessage", "Please check and make sure the Item Number was entered correctly.");
Note that you don't need to actually call FusionPro.Composition.Abort at all; in fact, that might make the composition error out completely, and not show your big red error at all. (Of course, there's nothing to stop the user from ordering the output with the big red error on it, but if they do that, they kind of get what they deserve.)
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #3  
Old November 20th, 2019, 09:57 AM
geeool geeool is offline
Junior Community Member
 
Join Date: Jun 2012
Location: Hilliard, OH
Posts: 22
Default Re: Abort Composition

Yes, they are placing orders with "Error" on the page. Repeatedly. Unfortunately, when this happens I'm tasked with contacting the buyer and explaining that the tags don't exist and we are cancelling their order.

The good thing about FusionPro.Composition.Abort is that it prevents the buyer from buying the non-existing tags. I think I will stick with it and just include extensive instructions above the form about what to do if they get the error message.

Thanks for the feedback!
Reply With Quote
  #4  
Old November 20th, 2019, 11:33 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,502
Default Re: Abort Composition

Quote:
Originally Posted by geeool View Post
Yes, they are placing orders with "Error" on the page. Repeatedly. Unfortunately, when this happens I'm tasked with contacting the buyer and explaining that the tags don't exist and we are cancelling their order.

The good thing about FusionPro.Composition.Abort is that it prevents the buyer from buying the non-existing tags. I think I will stick with it and just include extensive instructions above the form about what to do if they get the error message.
Okay, that sounds sensible. Though I still think that if you make the preview show "Invalid SKU number entered" in big red text, that that should be enough communication to the end user as to what they did wrong; but I've also learned that people have an amazing capacity to not read error messages.
Quote:
Originally Posted by geeool View Post
Thanks for the feedback!
No problem.

A couple other thoughts here, though I'm not really an expert on the MarcomCentral application:

First, there could, and probably should, be a better mechanism for FusionPro templates to return custom error messages like this to end users of MarcomCentral. I would put in a request to your CPM or Support person for this, though I can't make any promises at all as to when such new functionality would be available. But asking for it is the first step!

Also, I would think that, instead of having a free-form edit field for the user to type in the SKU number in MarcomCentral, and the possibility of entering a bad SKU that that entails, that you could instead provide a drop-down list of possible SKUs, which I think is possible to program into your store with the current MarcomCentral application. There may be a way to do some kind of custom validation on the form itself, before the FusionPro composition is even invoked; that's also something to ask your CPM about.

Blue-skying a bit more, I can imagine a custom site that would allow the user to select the item they want, based on a keyword search or something, which would show the picture of the item as well, kind of like how you would order something from Amazon or any other e-commerce site. That's obviously a lot more work for to program your store that way, and possibly requires enhancements to MarcomCentral itself. (Again, I'm not an expert on that.) But something to think about, anyway.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});

Last edited by Dan Korn; November 20th, 2019 at 11:37 AM..
Reply With Quote
Reply

Tags
composition abort

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 12:08 PM.


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