Views:

Overview

This how to article will show you how to pass a a field on the source record into a formula detail record (i.e. fetch-xml query). 

Scenario  

You need to apply a business validation rule where if a new order is being created, check to see if there is more than 50k worth of invoices outstanding for the customer associated with the new order. And if so present an error to the user and cancel the creation of the order. The tricky part here is passing in the customer id from the source record (i.e. on the order record) to the Fetch-XML query when the formula executes. This allows us to find all the unpaid invoices associated with the customer that you are creating the order for.

Steps

  • Create a new formula and set it up like the screenshot below:

  • Next navigate to the Advanced Find form and create a query like the one below:
  • When complete download the Fetch-XML
  • Take this Fetch-XML amd use it to create a formula detail record on the North52 formula
  • Where you see the condition for the customerid attribute change the guid value to a parameter, as shown below:

                  e.g.   value="{9528DA16-9E23-E211-B24B-984BE17C9A40}"  to   value="@customerid@"

  • This tells North52 BPA to pick up the customerid value from the source record (i.e. on the order) and inject it at runtime into the Fetch-XML so that you get all the unpaid invoices for that particular customer
  • You can now click save on the ribbon and test the formula