+ Start a Discussion
Manogna KoviManogna Kovi 

I have two objects one is a standard object i.e Account and the other one is a custom object and their have a look up relations .I have created 3 text fields as A,B,C in custom object.

I have two objects one is a standard object i.e Account and the other one is a custom object and their have a look up relations .I have  created 3 text fields as A,B,C in  custom object.Now when I concatenate b/w A and B , the result should get displayed in C.when u type the value manually in field C ,it should throw the error.So which type of trigger is used and how wil u write the code?
SalesforceDevil@16SalesforceDevil@16
Hello Manogna ,

You only need the ConCatinate value of A and B in C Field so why you need to throw error when user manually typing on this field ? ,

1.According to me You can make C field as readonly from pageLayout and populate C Value From trigger like this 
trigger ValidationOnField on Property__c (before insert) {
    
    for(Property__c p : Trigger.New){
        String conResult = p.A__c+' '+p.B__c;
        p.C__c=conResult;

    }

}

 
Nandigam RajeshNandigam Rajesh
Hello Manogna,
Hope this may helps you and better practice:

In formula field , choose "Output type" : Text and then use the formula Like : A__c +  B__c or need a space between them A__c + ' ' + B__c;
But by using this you cannot reused C field to entering manual data


Cheers
Rajesh