System Admin and Configuration

Get Involved. Join the Conversation.

Topic

    Kristina
    Business Rule to assign Opportunities based on created date
    Topic posted December 11, 2013 by KristinaRed Ribbon: 250+ Points 
    146 Views, 1 Comment
    Title:
    Business Rule to assign Opportunities based on created date
    Content:

    Hi all,

     

    we are trying to create opportunity business rules which assign an opportunity based on product type and created date, i.e.

    1. IF opportunity.product = mobile AND opportunity.created in range 00:00 - 11:59 THEN assign to Agent A

    2. IF opportunity.product = mobile AND opportunity.created in range 12:00 - 23:59 THEN assign to Agent B

    In Incident Business Rules this is quite straightforward, but it does not work in opportunity business rules, because the option is only available for a certain date & time, not only the time stamp.

    The only option available is relative time.

    We created a custom date field opportunity.c$created_date_rule. We are setting the value of opportunity.c$created_date_rule = opportunity.created, thus removing the time stamp and getting the date: 11/12/13 00:00.

    For the rules we used:

    1. IF opportunity.product = mobile AND opportunity.created < / = +12 hours relative opportunity.c$created_date_rule THEN assign to Agent A

    2. IF opportunity.product = mobile THEN assign to Agent B.

    However, this is not working and opportunities are always assigned to Agent A.

    We tried with "in range" "less or equal to" "not in range" but were unable to get it working.

    Does anyone have an idea how we can achieve this assignment?

    Thanks

    Kristina

    Comment

     

    • Mark Kehoe

      Hi Kristina,

      Funny you should mention that - there's a similar question on incidents posted elsewhere on the forums. You've got the right approach but it appears that there's something wrong with the custom field. If it was blank, then the first condition would always fire (time = zero or null).

      My guess is that the custom field is getting set in the opportunity rules and needs to be written back to the database before you can test it. This isn't the case in incidents (but I'll not use the word bug at this point!) So if you set the value using rules, you can then check in rules to see what the value is. You'll need to flush the rules through using a TRANSITION STATE which from my vaguest memory writes back the record to the database.

      If you are still having problems let me know and I've try something on my test database.

      Good question!!

      Mark