0

Workflow

I know I'm not the first person to ask this but I've read many blogs, none of them solved my problem. I have a custom object say "Invitation__c" where I have a custom Date field.

My requirement is I want the combination of Name and Date field to be unique. I already created a Unique Case Insensitive Text field (Composite_Key__c) and a Workflow rule (Everytime a record is created and edited) with Rule criteria Invitation: Composite Key EQUALS Invitation: Name & Date and a Field Update Workflow on Composite Key field. But its not solving my problem. Its only giving the error on Duplicate Name but not on the combination of Name and Date.

I guess the Workflow rule needs to be updated but I've tried many options, none solved it.Please help.

0

First of all -

the workflow criteria should be such that it fires every time. Something like :

Name is not '' (Blank)

Next the field update formula value should be like

Name & '-' & TEXT(MyDateField__c)

this should work

Please ensure -
1. its a date field and not datetime
2. Keep only name criteria in W/F rule. Remove the other one.

9
  • Thanks for your inputs. I edited the workflow as suggested: Rule criteria- (Invitation: Name NOT EQUAL TO null) AND (Invitation: Date NOT EQUAL TO null). Field update field: Field to Update- Invitation: Composite Key. Formula Value Name & "-" & TEXT(Date__c). But this is not solving the issue either. Please suggest. – Salesforce Learner Dec 8 '14 at 9:14
  • Does it work now? – Amit Bangad Dec 8 '14 at 9:16
  • Nope. :( Please refer my previous comment and suggest if I'm heading towards the right approach. – Salesforce Learner Dec 9 '14 at 8:40
  • Check updates to answer – Amit Bangad Dec 9 '14 at 10:37
  • I edited the rule. But still it is allowing me to create a duplicate record. Please note that at the toke of creating the record, I'm only entering data in Name and Date__c field and not in Composite key field as I only need the unique record against the combination of Name and Date__c field. – Salesforce Learner Dec 9 '14 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.