anthony.bice
August 19th, 2009, 09:56 AM
Hello All,
I've successfully placed a set of 6 conditions as an if/else statement within an On Record Start rule, which returns one of 6 different body pages based on pricing variable entries. I'm calling that a "set" of conditions.
I now need to add 2 additional layouts options [Unit of Sale] (which will contain 6 pages each, that change with the pricing entries); and, a pull down menu (i.e. 1 For, 2 For, 3 For) with three choices that will call the appropriate set of (6) conditions.
I've attempted to add the "Unit of Sale" conditions within all my statements with "Logical Ands", duplicate the set of 6 for the other 2 layouts, and edit the body pages that are being called.
Can anyone offer any help with this attempt or direction? Thanks. :-)
Here's my stab at containing this in one On Record Start Rule (it validates but doesn't return any preview so far) :
if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") >= 20)
{
FusionPro.Composition.SetBodyPageUsage("TwentyPlusPricingLayout", true);
}
else if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") == 11)
{
FusionPro.Composition.SetBodyPageUsage("DollarAmountEleven", true);
}
else if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") >= 10)
{
FusionPro.Composition.SetBodyPageUsage("DoubleDigitPricingLayout", true);
}
else if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") == 1)
{
FusionPro.Composition.SetBodyPageUsage("DollarAmountOne", true);
}
else if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") == "")
{
FusionPro.Composition.SetBodyPageUsage("LessThanOneDollar", true);
}
else (Field("UnitOfSale") == "1 For")
{
FusionPro.Composition.SetBodyPageUsage("SingleDigitPricingLayout", true);
}
if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") >= 20)
{
FusionPro.Composition.SetBodyPageUsage("2ForTwentyPlusPricing", true);
}
else if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") == 11)
{
FusionPro.Composition.SetBodyPageUsage("2ForDollarAmountEleven", true);
}
else if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") >= 10)
{
FusionPro.Composition.SetBodyPageUsage("2ForDoubleDigitPricing", true);
}
else if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") == 1)
{
FusionPro.Composition.SetBodyPageUsage("2ForDollarAmountOne", true);
}
else if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") == "")
{
FusionPro.Composition.SetBodyPageUsage("2ForLessThanOneDollar", true);
}
else (Field("UnitOfSale") == "2 For")
{
FusionPro.Composition.SetBodyPageUsage("2ForSingleDigitPricing", true);
}
if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") >= 20)
{
FusionPro.Composition.SetBodyPageUsage("3ForTwentyPlusPricing", true);
}
else if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") == 11)
{
FusionPro.Composition.SetBodyPageUsage("3ForDollarAmountEleven", true);
}
else if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") >= 10)
{
FusionPro.Composition.SetBodyPageUsage("3ForDoubleDigitPricing", true);
}
else if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") == 1)
{
FusionPro.Composition.SetBodyPageUsage("3ForDollarAmountOne", true);
}
else if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") == "")
{
FusionPro.Composition.SetBodyPageUsage("3ForLessThanOneDollar", true);
}
else (Field("UnitOfSale") == "3 For")
{
FusionPro.Composition.SetBodyPageUsage("3ForSingleDigitPricing", true);
}
I've successfully placed a set of 6 conditions as an if/else statement within an On Record Start rule, which returns one of 6 different body pages based on pricing variable entries. I'm calling that a "set" of conditions.
I now need to add 2 additional layouts options [Unit of Sale] (which will contain 6 pages each, that change with the pricing entries); and, a pull down menu (i.e. 1 For, 2 For, 3 For) with three choices that will call the appropriate set of (6) conditions.
I've attempted to add the "Unit of Sale" conditions within all my statements with "Logical Ands", duplicate the set of 6 for the other 2 layouts, and edit the body pages that are being called.
Can anyone offer any help with this attempt or direction? Thanks. :-)
Here's my stab at containing this in one On Record Start Rule (it validates but doesn't return any preview so far) :
if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") >= 20)
{
FusionPro.Composition.SetBodyPageUsage("TwentyPlusPricingLayout", true);
}
else if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") == 11)
{
FusionPro.Composition.SetBodyPageUsage("DollarAmountEleven", true);
}
else if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") >= 10)
{
FusionPro.Composition.SetBodyPageUsage("DoubleDigitPricingLayout", true);
}
else if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") == 1)
{
FusionPro.Composition.SetBodyPageUsage("DollarAmountOne", true);
}
else if (Field("UnitOfSale") == "1 For" && Field("DollarAmount") == "")
{
FusionPro.Composition.SetBodyPageUsage("LessThanOneDollar", true);
}
else (Field("UnitOfSale") == "1 For")
{
FusionPro.Composition.SetBodyPageUsage("SingleDigitPricingLayout", true);
}
if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") >= 20)
{
FusionPro.Composition.SetBodyPageUsage("2ForTwentyPlusPricing", true);
}
else if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") == 11)
{
FusionPro.Composition.SetBodyPageUsage("2ForDollarAmountEleven", true);
}
else if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") >= 10)
{
FusionPro.Composition.SetBodyPageUsage("2ForDoubleDigitPricing", true);
}
else if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") == 1)
{
FusionPro.Composition.SetBodyPageUsage("2ForDollarAmountOne", true);
}
else if (Field("UnitOfSale") == "2 For" && Field("DollarAmount") == "")
{
FusionPro.Composition.SetBodyPageUsage("2ForLessThanOneDollar", true);
}
else (Field("UnitOfSale") == "2 For")
{
FusionPro.Composition.SetBodyPageUsage("2ForSingleDigitPricing", true);
}
if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") >= 20)
{
FusionPro.Composition.SetBodyPageUsage("3ForTwentyPlusPricing", true);
}
else if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") == 11)
{
FusionPro.Composition.SetBodyPageUsage("3ForDollarAmountEleven", true);
}
else if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") >= 10)
{
FusionPro.Composition.SetBodyPageUsage("3ForDoubleDigitPricing", true);
}
else if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") == 1)
{
FusionPro.Composition.SetBodyPageUsage("3ForDollarAmountOne", true);
}
else if (Field("UnitOfSale") == "3 For" && Field("DollarAmount") == "")
{
FusionPro.Composition.SetBodyPageUsage("3ForLessThanOneDollar", true);
}
else (Field("UnitOfSale") == "3 For")
{
FusionPro.Composition.SetBodyPageUsage("3ForSingleDigitPricing", true);
}