Custom function to look up related records
Hi there.
We are trying to implement an approval process for Deals that requires (at the appropriate deal stage) approval of any deal that is to be performed for a "new" Account - that is, an account for which we have no previous deals that reached "Closed Won" stage. I think this requires setting up a function in the Deals module which looks up the related Account, and returns a True/False value depending on whether that account has any other deals that have reached Closed Won stage. But I am not sure what the code for this function would be.
On a related matter, is it possible to set up code/a function that, when a deal is closed as "closed won" it looks up the Account Type field in the account, and updates this to "Customer" if it is not already marked as such?
Thanks in advance....