Yesterday I spent four hours trying to get a saved search working properly, and I accidentally fixed it (yay, me!), but I'm not sure why what I did worked. As happy as I am (and lucky!) that it actually worked, I don't like stumbling upon a fix that I don't understand, so I'm hoping someone can explain why this is working the way it is.
I was trying to get a sum of the total value of item fulfillments, with each item fulfillment record having a custom field containing this monetary value. Unfortunately, simply using the custom field in the formula resulted in the custom field value being multiplied by the number of lot numbers in the item inventory detail. Figuring the fix for this would be to divide the returned value by the number of lots I created a Formula (Currency) Sum result field using {custbody_cntm_fulfill_amount}/COUNT({inventorydetail.inventorynumber}).
This threw the dreaded Unexpected Error. To make sure I didn't fat-finger something, I commented out the division, like so: {custbody_cntm_fulfill_amount}/*/COUNT({inventorydetail.inventorynumber})*/, and re-ran the search.
Voilà, it worked. My question is: Why did commenting out the division in the formula cause the correct behavior (i.e., division by the lot number quantity)?
Thanks!