function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MC-DragnierMC-Dragnier 

Check to Ensure No Two Records Have Same Name

Hi

 

We're currently putting together a customized version of Assets to track which pieces of our intellectual property are involved in any given service request.

 

There will be multiple types of assets, right now these are being differentiated through a picklist (although I forsee a potential solution in utilizing it as a record type instead)

 

Two examples of types would be Document or Rule.

 

We do not want to have any two documents with the same name, any two rules with the same name, etc.  However, we could have one document and one rule that have the same name.  So we could have Type: Document  Name: BetaGamma  and Type: Rule  Name: BetaGamma

 

Is there a way for me to run checks either via workflow on record creation or on record edit or using validation rules to error out whenever a record is trying to be saved that shares a type AND name with an existing record?

 

Thanks for your help.

Ankit AroraAnkit Arora

Don't think validation rule or workflow rule can help you in this. You need to create trigger for this.

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

MC-DragnierMC-Dragnier

Ankit,

 

Do you have any recommendations for resources to familiarize myself with APEX to create this trigger?  So far I haven't done any apex work within salesforce, it's all been customization through the standard configuration interfaces in salesforce.

Ankit AroraAnkit Arora

Here are some helpful links, please go in the series :

 

1) http://wiki.developerforce.com/index.php/Apex_Code:_The_World's_First_On-Demand_Programming_Language...

 

2) http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf

 

3) http://www.salesforce.com/us/developer/docs/apexcode/index.htm

 

Once you have an idea about Apex, then you can go with these links :

 

http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/

 

http://www.crmverse.com/write-your-first-salesforce-com-apex-trigger-overview/

 

If you are not from coding background then don't worry, you will learn apex/visualforce in some time. Documentation provided by salesforce is just awesome.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page