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
Galeeb SKGaleeb SK 

populating fields

 Hai,There are two fields, if the user populate two field values and if we combine(or concatenate) those values uniqueness should be maintained.(I.e., combination should be unique)

How to achieve this without coding ?
salesforce mesalesforce me
Hi check it once....

1) http://www.pardot.com/faqs/salesforce/how-do-i-copy-salesforce-com-account-fields-to-contact-fields/

2) 
trigger SetContactOnOrderItem on OrderItem__c (before update, before insert) {
    Set<Integer> shippingNumbers = new Set<Integer>();

    for (OrderItem__c collectNumFromOrder : Trigger.new) {
        shippingNumbers.add(collectNumFromOrder.Shipping_Customer_Number__c);
    }

    List<Contact> contactList = [SELECT id, Shipping_Customer_Number__c FROM Contact WHERE Shipping_Customer_Number__c IN :shippingNumbers];

    Map<Integer, Contact> shippingNumToContactMap = new Map<Integer, Contact>();

    for (Contact c : contactList) {
        shippingNumToContactMap.put(c.Shipping_Customer_Number__c, c);
    }

    for (OrderItem__c o : Trigger.new) {
        if (o.Shipping_Customer_Number__c != null) {
            o.Contact__c = shippingNumToContactMap.get(o.Shipping_Customer_Number__c).id;
        }
        else {
            o.Contact__c = null;
        }
    }
}

 
suresh sanneboina 4suresh sanneboina 4
Hi,

Please follow the below link
http://sfdcintegration.blogspot.in/2015/09/uniqueness-in-combination-of-two-fields.html
 
Galeeb SKGaleeb SK
How to achieve this with out any coding........
suresh sanneboina 4suresh sanneboina 4
Hi,

Please go through the link provided. This can be achieved without coding using workflow.

http://sfdcintegration.blogspot.in/2015/09/uniqueness-in-combination-of-two-fields.html