Jump to content

Bulk Copies for Variable Products - Duplicating & Suppressing Pages


MikeHartman

Recommended Posts

Salutations!

 

We have a bit of a complicated one here that we can't seem to figure out. The problem is as follows:

 

We have a variable product that requires a mail list upload. However, we want to have the ability for the user to enter in a quantity into a field to add bulk copies to the order. The only difference between bulk and mail copies is that the mail address is suppressed. Additionally, we want to put a cover sheet in front of bulk records and possibly output them as a separate file entirely so that production knows what is bulk and what is mail.

 

We have the solution below which works perfectly fine in FusionPro desktop. It will tack on a number of bulk copies to the end of the document and a cover sheet will precede them. However, it falls apart when composing in MarcomCentral. First of all, the preview will show the cover sheet no matter what. Second of all (and more important) is that the bulk records are not created at all once the job is processed on the dashboard. Can anyone provide some help? Why won't this work when done through MarcomCentral?

 

Many thanks in advance! The code for our OnRecordStart is below:

 

var RecordCount = 0;

   //Determine total # of records.
   if (FusionPro.Composition.isBatch)
   {
       // MarcomCentral
       RecordCount = Int(FusionPro.Composition.JobOptions["MCC_num_records"]);
   }
   else
   {
       // FP Desktop
       RecordCount = new ExternalDataFileEx(FusionPro.Composition.inputFileName, ",").recordCount;
   }

   //If current record is last record and a value is entered in the Bulk Count field, repeat the last record 
   //to equal the # of bulk count.
   if (CurrentRecordNumber() == RecordCount && Field("BulkCount").length > 0 && Int(Field("BulkCount")) > 0)
   {
           FusionPro.Composition.repeatRecordCount = (Int(Field("BulkCount"))+1);
   }

   //If on the first repeat record, enable the cover sheet for bulk product.
   if(CurrentRecordNumber() == (RecordCount+1))
   {
      FusionPro.Composition.SetBodyPageUsage("BulkCoverSheet", true);
   }

   //If on a repeat record, suppress the address block field.
   if(FusionPro.Composition.repeatRecordNumber != 1)
   {
       FindTextFrame("1234").suppress = true;

   } 

Link to comment
Share on other sites

I think the problem is that you're composing a preview, and previews are always single-record, by definition. So when you do a preview in MarcomCentral, or in FusionPro VDP Creator/Desktop in Acrobat for that matter, record repeating is disabled, so the repeat record number is always 1, and the frame never gets suppressed.
Link to comment
Share on other sites

While that might explain the preview page showing incorrectly, that still has us wondering why the records are not repeated on the composition when an actual order is placed. My understanding is that at that point, the piece is being composed via FusionPro server.
Link to comment
Share on other sites

I've done a couple hours of testing today to get this narrowed down. I placed the variables in text fields and sent them all the way through the dashboard. The results:

 

  1. The code correctly grabs the total number of records
  2. The code correctly grabs the current record
  3. The code correctly grabs the number of bulk records requested

 

Eventually, I decided to just see if I can get any records to repeat by placing the code below in the OnRecordStart with no conditionals:

 

FusionPro.Composition.repeatRecordCount = 2;

 

That code above should just create double the total number of records. It does this in desktop, but does not do so when submitting the variable product through Marcom. This is a similar issue to what was mentioned in this thread here.

 

Is there a reason why repeatRecordCount does not seem to function via MarcomCentral? Is there a different function I should be using?

 

Thanks in advance...getting closer to narrowing this down. :)

Link to comment
Share on other sites

What I would do is add some debugging to the rule, like so:

var RecordCount = 0;

//Determine total # of records.
if (FusionPro.Composition.isBatch)
{
   // MarcomCentral
   RecordCount = Int(FusionPro.Composition.JobOptions["MCC_num_records"]);
}
else
{
   // FP Desktop
   RecordCount = new ExternalDataFileEx(FusionPro.Composition.inputFileName, ",").recordCount;
}

Print("Record Count is " + RecordCount);
Print("Current Record Number is " + CurrentRecordNumber());
Print("BulkCount is " + Field("BulkCount"));

//If current record is last record and a value is entered in the Bulk Count field, repeat the last record 
//to equal the # of bulk count.
if (CurrentRecordNumber() == RecordCount && Field("BulkCount").length > 0 && Int(Field("BulkCount")) > 0)
{
   Print("Setting FusionPro.Composition.repeatRecordCount");
   FusionPro.Composition.repeatRecordCount = (Int(Field("BulkCount"))+1);
}

Print("repeatRecordCount is " + FusionPro.Composition.repeatRecordCount);

//If on the first repeat record, enable the cover sheet for bulk product.
if(CurrentRecordNumber() == (RecordCount+1))
{
   Print("Activating BulkCoverSheet");
   FusionPro.Composition.SetBodyPageUsage("BulkCoverSheet", true);
}

Print("repeatRecordNumber is " + FusionPro.Composition.repeatRecordNumber);

//If on a repeat record, suppress the address block field.
if(FusionPro.Composition.repeatRecordNumber != 1)
{
   Print("Suppressing frame 1234");
   FindTextFrame("1234").suppress = true;
}

Then, after you compose the job in MarcomCentral and download the PDF, change the extension of the file name in the browser from ".pdf" to ".msg" and download the log file, which should have additional information from the Print calls.

Link to comment
Share on other sites

Excellent! I didn't know that these log files could be generated or read -- very helpful. I submitted a file with a total of 50 records, and a BulkCount request of 20. After the header information, I get the following:

 

The <graphic> tag for copyhole "Full Imprint Graphic" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Wide Logo Graphic" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "FontSelectionFront" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Finished Coupon Graphic" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Product Logo" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Small Logo Graphic" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Manufacturer Logo" is missing a "file" or "resource" attribute; the invalid tag is ignored.
Record Count is 50
Current Record Number is 1
BulkCount is 20
repeatRecordCount is 1
repeatRecordNumber is 1
Graphic rule Preloaded_Finished_Coupon_Graphic did not return a resource of type graphic
Graphic rule Preloaded_Small_Logo_Graphic did not return a resource of type graphic
Graphic rule Preloaded_Wide_Logo_Graphic did not return a resource of type graphic
Composing record #1, input record 1
OnCopyfit, line 3: warning: Could not copyfit text in flow 

 

The graphic rule errors are fine -- they're the result of rules pulling external resources and conditional page suppression. From looking at this, the total records and current records are fine, as well as the bulk count. The repeatRecordCount is correctly set until 1.

 

These repeat as expected until the last record, which shows the following:

The <graphic> tag for copyhole "Full Imprint Graphic" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Wide Logo Graphic" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "FontSelectionFront" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Finished Coupon Graphic" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Product Logo" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Small Logo Graphic" is missing a "file" or "resource" attribute; the invalid tag is ignored.
The <graphic> tag for copyhole "Manufacturer Logo" is missing a "file" or "resource" attribute; the invalid tag is ignored.
Record Count is 50
Current Record Number is 50
BulkCount is 20
Setting FusionPro.Composition.repeatRecordCount
repeatRecordCount is 21
repeatRecordNumber is 1
Graphic rule Preloaded_Finished_Coupon_Graphic did not return a resource of type graphic
Graphic rule Preloaded_Small_Logo_Graphic did not return a resource of type graphic
Graphic rule Preloaded_Wide_Logo_Graphic did not return a resource of type graphic
Composing record #50, input record 50, repeat 1 of 21
OnCopyfit, line 3: warning: Could not copyfit text in flow 
Job ended 09:55:04 - 1348764904.

 

We can see that repeatRecordCount is correctly set to 21 and the conditional print is indeed called. The third line from the bottom even says "repeat 1 of 21". Then it abruptly ends without repeating...any ideas? It seems like the problem is that the records aren't being repeated correctly when composed.

Link to comment
Share on other sites

Hi, Dan -- thanks for the quick replies. I added it to the end of the OnRecordStart rule. At the end of each record (from the first to final), the log reads:

 

CompMode is undefined

I'm guessing this isn't the desired outcome?

No, that's what I would expect for a non-Preview composition. If it had said "Preview," then repeats would be disabled. So something else is preventing the record from repeating. Try this:

Print("IgnoreRecordRepeat is " + FusionPro.Composition.JobOptions.IgnoreRecordRepeat);

Link to comment
Share on other sites

Ah hah -- I think we might be getting somewhere here. I added the line at the end of the function, and this result is added to each record:

 

IgnoreRecordRepeat is Yes

Is there any way this can be set to "No"?

This is the problem. Assuming that you don't have the "Ignore Record Repeat during Composition" box on the Input tab of the Composition Settings dialog checked when you collected the job, then MarcomCentral is changing this setting. Unfortunately, I can't answer your question about how to get MCC to set it to "No" instead, or at least to not change the setting from the uploaded template. This is an issue to bring up with your CPM, to ask why MCC disallows record repeating, even in non-Preview compositions.

Link to comment
Share on other sites

The button is not checked in the Compose settings, and the .CFG file it generates lists "IgnoreRecordRepeat=No". It does look like MarcomCentral is changing the setting upon upload. I'll talk to our CPM to see if we can get this worked out.

 

Thanks for your help, Dan!

Link to comment
Share on other sites

Right before I was about to send an email, I checked the Configuration tab for the template in MarcomCentral. Under the Edit Press Settings section, there is an option for Disable Repeat Records. The option defaults to "Yes" for some reason.

 

I changed the option to "No" and re-published the product. It works like a charm now. :D

 

Thanks again for all your help...I guarantee I wouldn't have figured it out otherwise!

Link to comment
Share on other sites

Right before I was about to send an email, I checked the Configuration tab for the template in MarcomCentral. Under the Edit Press Settings section, there is an option for Disable Repeat Records. The option defaults to "Yes" for some reason.

 

I changed the option to "No" and re-published the product. It works like a charm now. :D

 

Thanks again for all your help...I guarantee I wouldn't have figured it out otherwise!

Ah, great, glad to help. I would still contact your CPM and ask why it's set to disable repeats by default.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...