Spent a considerable amount of time trying different formulas in a formula field but none produce any results.
Can someone here tell me what I'm doing wrong or show me a better way?
- Created a sales order but the formula field remained empty
- Edited/saved an existing Sales Order but the formula field remained empty
The goal is to extract the third word from the Subject field in the Sales Orders Module and put that word in a formula field named "Order Number". Here are my testing details:
- All Test Sales Orders have the following text in their Subject field
"Order Number XXXX for ACME" the X's contain varying numbers - created a formula field using the String Return Type

- Created and Validated my formula

- Here is my Formula - using Find for second whitespace and Find for third whitespace as arguments for the Substring function. And then put all of that inside a Trim function to remove the whitespaces created by the Substring function. I used the If function just in case the Subject field is empty (Should never happen since the Subject field is required)
If(${Sales Orders.Subject}=='','',Trim(Substring(${Sales Orders.Subject},Find(' ',${Sales Orders.Subject},2),Find(' ',${Sales Orders.Subject},3))))