kopytekinc Posted July 8, 2010 Share Posted July 8, 2010 I have an odd bit where I need to select from different pages dependant on a variable or 2 in the data, my current rule reads as this if (Field("PC_USED") = "Court Reporting Institute of Houston") CardFront = "Court Reporting Institute of Houston" + "-front"; CardBack = "Court Reporting Institute of Houston" + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); else if (Field("PC_USED") = "Court Reporting Institute of Dallas" CardFront = "Court Reporting Institute of Dallas" + "-front"; CardBack = "Court Reporting Institute of Dallas" + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); else CardFront = Field("DESC") + "-front"; CardBack = Field("DESC") + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); What this should do is, if the case is met for Either Court Reporting Institute of Dallas or Houston in the PC_USED field, they would get use the pages listed, while the rest of the cards would use the DESC field to determine the pages used. Clearly I am missing something with my if statements just cant sort what. Thanks for the help Link to comment Share on other sites More sharing options...
LesSjo Posted July 8, 2010 Share Posted July 8, 2010 You seem to be missing some parens and brackets, but without knowing what your pages are named, I can't say that is all that is wrong, but it should get you closer. if (Field("PC_USED") = "Court Reporting Institute of Houston") { CardFront = "Court Reporting Institute of Houston" + "-front"; CardBack = "Court Reporting Institute of Houston" + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); } else if (Field("PC_USED") = "Court Reporting Institute of Dallas") { CardFront = "Court Reporting Institute of Dallas" + "-front"; CardBack = "Court Reporting Institute of Dallas" + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); } else { CardFront = Field("DESC") + "-front"; CardBack = Field("DESC") + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); } Hope it helps. Link to comment Share on other sites More sharing options...
kopytekinc Posted July 8, 2010 Author Share Posted July 8, 2010 Looks cleaner and more like where I was going, but unfort now I get a new error that I am unsure of its reasoning, says Invalid Assignment left hand side. This is a callback rule to run on job start Link to comment Share on other sites More sharing options...
LesSjo Posted July 8, 2010 Share Posted July 8, 2010 duh. if (Field("PC_USED") [color=Red]==[/color] "Court Reporting Institute of Houston") { CardFront = "Court Reporting Institute of Houston" + "-front"; CardBack = "Court Reporting Institute of Houston" + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); } else if (Field("PC_USED") [color=Red]==[/color] "Court Reporting Institute of Dallas") { CardFront = "Court Reporting Institute of Dallas" + "-front"; CardBack = "Court Reporting Institute of Dallas" + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); } else { CardFront = Field("DESC") + "-front"; CardBack = Field("DESC") + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); }also, this should probably be used in an onRecordStart rule, not an nJobStart rule... Link to comment Share on other sites More sharing options...
kopytekinc Posted July 8, 2010 Author Share Posted July 8, 2010 Yep, was setup on RecordStart and of course == such a simple thing, thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.