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.