Sequential Numbering + Quantity + Start Number = Frustration

Recommended Posts

I have a print template for our online store that's giving me a really annoying issue that I can't seem to fix. It's a 1-page "pool pass" file that's sequentially numbered. Rather than specify a start and stop sequence number, the user specifies the number of passes they want, as well as the starting number in the sequence. So for example if they want 250 tickets starting with number 1, the job will compose 250 pages, numbered 1 thru 250. The problem I'm having is that if they specify a starting sequence number greater than 1, the first number returned during composition is that number PLUS 1. So let's say the user specifies a quantity of 500 tickets, starting with number 750... When I compose, the output file starts at 751, not 750. This is annoying and I'm sure a simple fix.

I'm using 2 rules:

Sequential Numbering Rule

```var start = Field("Start Number");

new_val = start-1

and OnRecordStart

```FusionPro.Composition.repeatRecordCount = Field("Quantity");
var seq = Field("Start Number");
var result = (Int(seq) - 1) + FusionPro.Composition.repeatRecordNumber;
return result;```

Can anybody lend a guy a hand?

Share on other sites

I have a print template for our online store that's giving me a really annoying issue that I can't seem to fix. It's a 1-page "pool pass" file that's sequentially numbered. Rather than specify a start and stop sequence number, the user specifies the number of passes they want, as well as the starting number in the sequence. So for example if they want 250 tickets starting with number 1, the job will compose 250 pages, numbered 1 thru 250.

Okay, that sounds fine.

The problem I'm having is that if they specify a starting sequence number greater than 1, the first number returned during composition is that number PLUS 1.

What do you mean by "returned during composition?" Do you mean a number that's shown somewhere in the output?

So let's say the user specifies a quantity of 500 tickets, starting with number 750... When I compose, the output file starts at 751, not 750. This is annoying and I'm sure a simple fix.

Again, I'm not sure what you mean by "the output file starts at 751."

I'm using 2 rules:

Which rule is the one that's putting the number out?

Sequential Numbering Rule

```var start = Field("Start Number");

new_val = start-1

There are several things confusing here. Why do you call FormatNumber with an empty format string?

Also, I think you want the first line to be:

`var start = Int(Field("Start Number"));`

But I think the problem is that, if you're setting a repeat count, then instead of CurrentRecordNumber(), you want FusionPro.Composition.repeatRecordNumber, which you seem to be sort of on the track of here:

and OnRecordStart

```FusionPro.Composition.repeatRecordCount = Field("Quantity");
var seq = Field("Start Number");
var result = (Int(seq) - 1) + FusionPro.Composition.repeatRecordNumber;
return result;```

What do you think that anything after the first line of this rule is doing? If you validate the rule, it says that the returned value is ignored at composition time, right? This means exactly what it says. This "result" that you're calculating has no effect on the output at all.

What you need to do is much simpler than what you have. First, in OnRecordStart, just set the repeat count:

`FusionPro.Composition.repeatRecordCount = Int(Field("Quantity"));`

Then, in your other rule, which you will use to set the text in the output, just return the repeat number, offset by the desired starting number:

`return FusionPro.Composition.repeatRecordNumber + Int(Field("Start Number")) - 1;`

Or, you could do this all in OnRecordStart, by injecting the variable with the name of that other rule, something like:

```FusionPro.Composition.repeatRecordCount = Int(Field("Quantity"));
var ticketNum = FusionPro.Composition.repeatRecordNumber + Int(Field("Start Number")) - 1;
```

Share on other sites

Thanks for your help, Dan. I know I'm making an overly complicated explanation for a very basic mathematical problem. You seemed to grasp it though cuz the corrections you suggested to my 2 rules worked perfectly
Share on other sites

Okay, I knew that was too easy... I'm not sure if this followup question belongs here or under Manager-Specific Discussion but at any rate, the template works perfect when I compose on my desktop. However, it does not function on the store front, when proofing and adding to cart. However-ever, if I complete the order and then download the print-ready output file from Dashboard, the file is correct. Is there something I can do to make the template proof correctly? In other words, if the user chooses a "Quantity" of 250 and a starting sequence number, the proof they see on the screen after pressing the green refresh button will display 250 sequentially numbered pages.
Share on other sites

Okay, I knew that was too easy... I'm not sure if this followup question belongs here or under Manager-Specific Discussion but at any rate, the template works perfect when I compose on my desktop. However, it does not function on the store front, when proofing and adding to cart. However-ever, if I complete the order and then download the print-ready output file from Dashboard, the file is correct. Is there something I can do to make the template proof correctly? In other words, if the user chooses a "Quantity" of 250 and a starting sequence number, the proof they see on the screen after pressing the green refresh button will display 250 sequentially numbered pages.

Yes, this is now a MarcomCentral-specific question.

But I'm pretty sure that MCC sets "IgnoreRecordRepeat=Yes" in the CFG file (the equivalent of checking the "Ignore Record Repeat during Composition" button on the Input tab of the Composition Settings) for store previews, the idea being that a preview should only compose one record. That's very sensible, in my opinion. Does the end user really need 250 records of output for the preview?

You might be able to get around this by doing it the old way. Instead of instead of repeating the record, you can set FusionPro.Composition.composeAllRecords = false and FusionPro.Composition.endRecordNumber to 250 in OnJobStart, and use CurrentRecordNumber() or FusionPro.Composition.processedRecordNumber in the rule returning the ticket number. But I think Marcom might override the end record number for the store preview as well. Again, do you really need 250 records for a preview?

Share on other sites

Again, do you really need 250 records for a preview?

Well...... maybe. That ties in to another issue I'm having which I'm almost certain is MarcomCentral-specific. Has to do with pricing, either Page Count or Dynamic (iForms) pricing. In my mind, because the preview doesn't display the full 250, 500 or 1000 page proof, the pricing it displays is incorrect as a result. I'm almost certain that's because I'm not using the right combination of base and/or Dynamic and/or Page Count pricing. Currently, I have the "Quantity" variable that determines the number of times to duplicate the record, and then there's also the Quantity drop-down the user selects to Add to Cart. In a perfect world, the pricing and output file would all be generated off of my Quantity variable. That might be impossible though.

So to answer your question, no, 250 (or 500 or 1000) records are not necessary for the preview as long as that's not what drives my pricing.

Share on other sites

Well...... maybe. That ties in to another issue I'm having which I'm almost certain is MarcomCentral-specific. Has to do with pricing, either Page Count or Dynamic (iForms) pricing. In my mind, because the preview doesn't display the full 250, 500 or 1000 page proof, the pricing it displays is incorrect as a result. I'm almost certain that's because I'm not using the right combination of base and/or Dynamic and/or Page Count pricing. Currently, I have the "Quantity" variable that determines the number of times to duplicate the record, and then there's also the Quantity drop-down the user selects to Add to Cart. In a perfect world, the pricing and output file would all be generated off of my Quantity variable. That might be impossible though.

So to answer your question, no, 250 (or 500 or 1000) records are not necessary for the preview as long as that's not what drives my pricing.

You've exhausted my knowledge of MarcomCentral. For your other questions, you should either post to the MarcomCentral sub-forum, or ask your BRM.

Share on other sites

I figured this might be outside of your realm, but you atleast got my first issue working. Thanks again!

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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×

• FusionPro.com

• MarcomCentral
×
• Create New...