• Rajesh-SFDC
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
Hi everybody,

Is there any way to put custom error message based on some field criteria before submitting for Approval .

Let's say i have field A if it is blank and when i submit for approval then i want custome error message to be dislayed !

Thanks in advance !
Hi All,

I am facing issue get elemnet by id in below function returning null even putting value into the field .Below is my code 
<apex:page STAndardController="Candidate__c" tabStyle="Candidate__c" id="a" >
<script>
{

alert("Email Address Mismatch"+document.getElementById("{!$Component.a.b.c.d.email}"));
return false;
}</script>
<apex:pageMessages />
<apex:form id="b">
<apex:pageBlock title="New candidate" id="c">

<apex:pageBlockSection title="Information" columns="2" id="d" >
<apex:inputField value="{!Candidate__c.Title__c}"/>
<apex:inputField value="{!Candidate__c.First_Name__c}"/>
<apex:inputField value="{!Candidate__c.Last_Name__c}"/>
<apex:inputField value="{!Candidate__c.SSN__c}"/>
<apex:inputField value="{!Candidate__c.Gender__c}"/>
<apex:inputField value="{!Candidate__c.DOB__c}"/>
<apex:inputField value="{!Candidate__c.Phone__c}"/>
<apex:inputField value="{!Candidate__c.Mobile__c}"/>
<apex:inputField value="{!Candidate__c.Email__c}" id="email" onkeydown="return DisableCtrlKey(event)" onMouseDown="DisableRightClick(event)"/>
<apex:inputField value="{!Candidate__c.Confirm_Email_Addrees__c}" id="cnfrmemail" onkeydown="return DisableCtrlKey(event)" onMouseDown="DisableRightClick(event)"/>
<apex:inputField value="{!Candidate__c.PAN__c}"/>
</apex:pageBlockSection>
<div align = "Center">
<apex:commandButton action="{!save}" value="SAVE" onclick="return validate()"/>
<apex:commandButton action="{!quicksave}" value="Quick Save"/>
</div>

</apex:pageBlock>
</apex:form>
</apex:page>


here even in the email filed value is there it is returning null your help on this would be great.
i used direct as well as level access of IDs.
I have to access the highlighted the above highlighted field in java script .
 
Hi Everyone , 

I am new to trigger i had one requirement to write a trigger for dublicate email detection in bulk mode .
I tried below code 

trigger DublicateEmailDetection on Candidate__c ( before insert,before update ) {
List<Candidate__c> EmailList = [Select Email__c from Candidate__c];
    Set<String> setString = new Set<String>();
    for (Candidate__c k : EmailList )
    {
     setString.add(k.Email__c);
    } 
    for(Candidate__c c : Trigger.new)
    {
    if(setString.contains(c.Email__c))
        {
        c.Email__c.addError('Duplicate Email');
        
        }
    }

Can you please check if this code will work fine in bulk mode ?
Youre help is really appreciated 
Hi Everybody,

I am new to salesforce security just wanted to have understanding on Sharing rules i have below doubt 
a) Suppose we have CEO Role at highest level and Recruitment Manager at lowest level of CEO and CEO have all object access what Recuritment manger Have and for all object Grant Access Using Hierarchies in org default is selcted my doubt is whether the record will be accesible to CEO what Recruitment Manager created or do we need to create sharing rules ?
b) What is the sharing rule and Manual Sharing Rule ?
 
Hi everybody,

Is there any way to put custom error message based on some field criteria before submitting for Approval .

Let's say i have field A if it is blank and when i submit for approval then i want custome error message to be dislayed !

Thanks in advance !
Hi All,

I am facing issue get elemnet by id in below function returning null even putting value into the field .Below is my code 
<apex:page STAndardController="Candidate__c" tabStyle="Candidate__c" id="a" >
<script>
{

alert("Email Address Mismatch"+document.getElementById("{!$Component.a.b.c.d.email}"));
return false;
}</script>
<apex:pageMessages />
<apex:form id="b">
<apex:pageBlock title="New candidate" id="c">

<apex:pageBlockSection title="Information" columns="2" id="d" >
<apex:inputField value="{!Candidate__c.Title__c}"/>
<apex:inputField value="{!Candidate__c.First_Name__c}"/>
<apex:inputField value="{!Candidate__c.Last_Name__c}"/>
<apex:inputField value="{!Candidate__c.SSN__c}"/>
<apex:inputField value="{!Candidate__c.Gender__c}"/>
<apex:inputField value="{!Candidate__c.DOB__c}"/>
<apex:inputField value="{!Candidate__c.Phone__c}"/>
<apex:inputField value="{!Candidate__c.Mobile__c}"/>
<apex:inputField value="{!Candidate__c.Email__c}" id="email" onkeydown="return DisableCtrlKey(event)" onMouseDown="DisableRightClick(event)"/>
<apex:inputField value="{!Candidate__c.Confirm_Email_Addrees__c}" id="cnfrmemail" onkeydown="return DisableCtrlKey(event)" onMouseDown="DisableRightClick(event)"/>
<apex:inputField value="{!Candidate__c.PAN__c}"/>
</apex:pageBlockSection>
<div align = "Center">
<apex:commandButton action="{!save}" value="SAVE" onclick="return validate()"/>
<apex:commandButton action="{!quicksave}" value="Quick Save"/>
</div>

</apex:pageBlock>
</apex:form>
</apex:page>


here even in the email filed value is there it is returning null your help on this would be great.
i used direct as well as level access of IDs.
I have to access the highlighted the above highlighted field in java script .
 
Hi Everyone , 

I am new to trigger i had one requirement to write a trigger for dublicate email detection in bulk mode .
I tried below code 

trigger DublicateEmailDetection on Candidate__c ( before insert,before update ) {
List<Candidate__c> EmailList = [Select Email__c from Candidate__c];
    Set<String> setString = new Set<String>();
    for (Candidate__c k : EmailList )
    {
     setString.add(k.Email__c);
    } 
    for(Candidate__c c : Trigger.new)
    {
    if(setString.contains(c.Email__c))
        {
        c.Email__c.addError('Duplicate Email');
        
        }
    }

Can you please check if this code will work fine in bulk mode ?
Youre help is really appreciated 
How to write trigger to avoid duplicate email when bulkfying the trigger

my trigger is:

trigger AvoidDuplicate on contact (before insert,before update)
{
   if(Trigger.isInsert||Trigger.isUpdate)
      for(contact a:trigger.new)
     {
         integer count=[select count from contact where email=:a.email];
         if(count>0)
          {
                 a.Email.adderror('This email already exists');
          }
     }
}

this is working fine when inserting single records

but it shows error when working with dataloader...... Please help to to over come this error


I would appriciate for any kind of replay...............