You need to sign in to do that
Don't have an account?
Custom Object Formula field
Hi All
Wonder if anyone can help
I have several custom objects and record types.
One record type is a Field Survey. I want to build a formula that stats if the custom object record type is field survey and that the action field is updated to "complete" that three other custom fields are required. But I am lost, new to Salesforce so any help greatly appreciated
AND (
OR (
ISPICKVAL($ObjectType.Work_Order__c.Fields.RecordTypeId , "Field_Survey"),
ISPICKVAL( Action__c , "Complete"),
ISBLANK( Cabling_Cost__c )))
The error message "Error: Incorrect parameter for function ISPICKVAL(). Expected Picklist, received Object"
Thanks for the help
Geri
Okay, you're missing the OR function from my Formula, either of these should work for you
Cheers!
PS. You owe me a beer!
All Answers
First off, Record Type is not a Picklist Value.
What are the datatypes and values of the fields that you want to make required?
Here's a VR Formula that I wrote that checks the Record Type and a Picklist Field. If the Record Type = "Test 1" and Picklist_1 = Completed, then the following 3 fields are required. If the Record Type is not "Test 1" OR Picklist_1 is not = Completed, then none of the fields is required.
Hi Stevemo
thanks so much for your reply,, honestly formulas in Salesforce confuse me.
I have used the following formula, which works in part
AND(
$RecordType.Name = "Field Survey",
ISPICKVAL( Action__c , "Complete"),
ISBLANK( Cabling_Cost__c ),
ISBLANK( Civils_Costs__c ),
ISBLANK( Splicing_Cost__c ))
If I select complete and enter no values, it gives me the error, however once I fill in a value in the civils cost field, it will allow me to save the record. However I want it to only allow me to save once all fields have a value even if that value is zero for the three. I'm guessing the "LEN" part of your formula is what I need to use, but I dont understand it, so if you could help, I'd be very grateful, thanks
Geri
Hi Geri,
What is the Datatype of each of the fields in your VR Formula?
Hi Stevemo
The three fields are currency fields
Thanks
Geri
Do they need to be > $0.00 or do they just have to not be empty?
just not empty.
Each are formatted to 2 decimal places, but if I enter "0" then it saves it as €0.00
Okay, you're missing the OR function from my Formula, either of these should work for you
Cheers!
PS. You owe me a beer!
Stevemo
Thank you so much, works perfectly....
I'd buy you a bar full of beers,,,, never mind a beer
Thanks again
Geri
Fair enough, I like to drink these>
http://beeradvocate.com/beer/profile/863/7971/
Cheers!