Views:

Scenario Overview


In this scenario , we need to be able to check for an Accounts free time periods when needed. We will use the Appointments associated with this Account to measure its free time. 

 

N52 Formula Manager Solution

The Formula Manager solution works like this:

  • A formula of type 'Process Genie' is created. 
  • A quick button is created on the Account and it is set up to trigger the formula
  • The Formula takes 2 custom field - Start Time Check and End Time Check - and finds all free time periods between Appointments for this Account
  • It then outputs this result into the Description field. 

Note 1: You will need to create the 2 custom fields beforehand. In this example, we named them new_starttimecheck and new_endtimecheck

 

N52 Formula Manager Steps  

The following set of steps outline how to create this Formula:

  • Create a new formula of type 'Process Genie' 
  • Set the Mode to 'Serverside'
  • Set the Source Entity to 'Account'
  • Go to the Formula editor
  • Copy and paste the formula below
  • Click Save


       

Formula

Smartflow (
  
  SetVar('EntityCollectionResult' ,
 	      TimePeriodsFindGaps(FindRecordsFD('All Appointments',
                                             'true',
                                             SetParams([account.accountid])),
   		  'scheduledstart',
   		  'scheduledend',
   	       [account.new_starttimecheck], 
  		  [account.new_endtimecheck])			
  			),


  UpdateRecord('account', 
               [account.accountid], 
                SetAttribute('description',
                              OutputtoTrace( GetVar('EntityCollectionResult' ))))
  
  )

Quick Button

Please see article  at this link for instructions on how to set up the quick button which will trigger this formula.
 

Did you know?

xCache helps you manage environment specific configuration

North52's Decision Suite component xCache allows you to set up environment specific data to allow you to use different values for different instances. Your advanced business rules logic could be the same, however you need to use specific reference values for a particular instance.

For example, credentials for a web service used in your Formula - you will likely use different keys/URLs for your Dev, Test and Production instances. Store these in xCache and let the North52 business rules engine apply the correct ones at runtime! 

Learn more and see examples of xCache