Results 1 to 6 of 6

Thread: Custom colours

  1. #1
    Join Date
    Mar 2015
    Location
    Tobermory, ON
    Posts
    4

    Default Custom colours

    Hi Stan. I've been customizing our grid (rack) colours for various reservation types with good success, but I've bumped up against one scenario that has me stumped. For cabin bookings of 5 or more days, we process the balance 30 days in advance of arrival, and I'd like those bookings to be a different colour on the grid. So I need to build two expressions, one for guaranteed cabin bookings of 5+ days, another for guaranteed, chosen (don't move) cabin bookings for 5+ days. This is what I've done, but it isn't working:

    ColorStatusResv(Resv(),ThisDate(),ThisPeriod()) = 24 AND Resv:Resv_Type = "Normal" AND Site:Attrib_Site_Type = "Cabin" AND ((Resv:Resv_Last_Date - Resv:Resv_First_Date) +1) >=5

    ---

    ColorStatusResv(Resv(),ThisDate(),ThisPeriod()) = 50 AND Resv:Resv_Type = "Normal" AND Resv:Resv_Dont_Move AND Site:Attrib_Site_Type = "Cabin" AND ((Resv:Resv_Last_Date - Resv:Resv_First_Date) +1) =>5

    Where am I going wrong?

  2. #2

    Default

    The only obvious problem I see is in the 2nd one, "=>" should be ">=".

    You don't need to test Resv_Dont_Move in the 2nd one because the status value already tells you it's don't-move.

    I don't think it matters, but also try putting a space after the + in +1

    Of coruse I'm assuming that you really do have a "Normal" for the resv type and "Cabin" for the Site Type so those match.
    Stan Spielbusch
    [Forum Administrator]

  3. #3

    Default

    BTW, make sure this is above any others that might override it -- if it's showing one of your OTHER custom colors, then you need to move it up in the list of rules. And of course it needs to be in the same Color Scheme definition as your other custom colors, since only one can be selected for the Override reservation color scheme.
    Stan Spielbusch
    [Forum Administrator]

  4. #4
    Join Date
    Mar 2015
    Location
    Tobermory, ON
    Posts
    4

    Default

    Thank you for your help, Stan, but it still isn't working. I fixed the >=, added a space before the 1, removed the "Don't Move" in the second expression, and moved those custom expressions to the very top of our custom colour rules. Yes, we have a "Normal" res type and a "Cabin" site type. I'm at a loss. Is it possible that, rather than as a site type, I should test for "Cabin" as rig type - seeing as the cabin is selected as the camping unit for those customers? Or should I test for both?

    P.S.: When I calculate these expressions as they are, I get the "Operator/operand type mismatch" error, and it is the "(last - first) +1" part that causes the error. When I remove that, it returns a "false".
    Last edited by VivienS; 04-02-2015 at 03:54 PM. Reason: P.S. added

  5. #5

    Default

    Getting an error like that when you calculate is certainly a problem (returning False is OK). The last - first expression may not work. There is a function for getting ResvNights(), try that instead.

    Other than that, I can't really tell what the problem might be by just seeing the expressions. It could be something unrelated, like the order of rules, what you really have in your pick lists, etc.
    Stan Spielbusch
    [Forum Administrator]

  6. #6
    Join Date
    Mar 2015
    Location
    Tobermory, ON
    Posts
    4

    Default

    Hello Stan. I should have posted before, but we did end up solving this a few days ago. Using the function did not work initially, until we realized that the context was missing. This is what the expressions now look like, and they're working:

    ColorStatusResv(Resv(),ThisDate(),ThisPeriod()) = 24 AND Resv:Resv_Type = "Normal" AND Site:Attrib_Site_Type = "Camping Cabin" AND ResvNights(ThisResv()) >= 5

    ColorStatusResv(Resv(),ThisDate(),ThisPeriod()) = 50 AND Resv:Resv_Type = "Normal" AND Site:Attrib_Site_Type = "Camping Cabin" AND ResvNights(ThisResv()) >= 5

    Thanks again.

Similar Threads

  1. Adding a custom field
    By wdadli1 in forum Technical Support
    Replies: 6
    Last Post: 09-01-2011, 06:24 PM
  2. Custom Colors
    By fsttp in forum Technical Support
    Replies: 2
    Last Post: 10-14-2010, 08:03 AM
  3. Custom Scripting
    By whosbob in forum Technical Support
    Replies: 9
    Last Post: 07-21-2010, 11:14 AM
  4. Custom demo
    By carydco in forum Technical Support
    Replies: 1
    Last Post: 04-09-2010, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •