• Manas Kanti Datta
  • 5 Points
  • Member since 2018

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
  • 5
Hello guys,
i am looking for the best way to handle validation rules in apex triggers. Sometimes i want to execute some dml actions after the record is validated. 

Is it possible to query all my validation rules and extract the error condition ? i don't want to translate my validation rules into apex and i am pretty sure, that there is better way to do that.  

Another option is to translate all my validation rules into apex methodes to receive a boolean. So it would be possible to use them in classes and triggers.

I hope you will understand my concers and i am appreciate your help ! 
Hi Development Community, 

I am trying to build a test class for the controller I built, the controller is just pull some data from the system. However, I have tried numerous ways to build the test but got 0 coverage all the time. Any hint or help? 

Thanks for your help.

Below is my controller,
public with sharing class MDSExtension
    public string Object1id {get; set;}
    public string Object2id {get; set;}
    public string Object3id {get; set;}
    public Object1_c SelectedObject1{get;set;}
    public Object2_c SelectedObject2{get;set;}
    public Object3_c SelectedSD {get;set;}
    public List<Object1_c> Object1 { get;set; }
    public List<Object2_c> Object2 { get;set; }
    public List<Object3_c> Object3 { get;set; }
    public MDSExtension(ApexPages.StandardController controller)
        Object1= [
            SELECT Name, RecordType.DeveloperName FROM Object1_c
            WHERE Client__c = :controller.getId() AND RecordTypeID= '0127F000000gkUkQAI'
        Object2= [
            SELECT Name, RecordType.DeveloperName  FROM Object2_c
            WHERE Client__c = :controller.getId() AND RecordTypeID= '0127F000000gkUVQAY'
        Object3= [
            SELECT Name, Client__c FROM Object3_c
            WHERE Client__c = :controller.getId() 
public PageReference save(){    
return null;

hi team ,
Below error message when i am deplpoyiong total copy from my system .
Error: Invalid Data.  Review all error messages below to correct your data. Apex trigger AvoidDuplicate caused an unexpected exception, contact your administrator: AvoidDuplicate: execution of BeforeInsert caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Contact.Phone: Trigger.AvoidDuplicate: line 27, column 1
  • June 26, 2019
  • Like
  • 0

Hi all, I am so close to finishing this process automation badge but am stuck in one area in Step 7.

I've built out my process builder as follows

User-added image
User-added image
User-added image

And my date formula as follows

Case(MOD(Date__c-DATE(1900,1,7),7),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5, "Friday",6,"Saturday", "")

Challenge Not yet complete... here's what's wrong:  The Robot Setup Day of the Week formula does not seem to be working properly. The Day of the Week should not fall on Saturday or Sunday. 

It works nicely but doesn't seem to pass, what could be up.

I am getting this error when trying to add a currency type field to a VF page. I expect it has somethign to do with multicurrency being enabled in the org but I don't know how to handle it. Here is my apex code... if I remove the column and outputfields for opportunity.amount, then the page works fine.
How do I deal with correcting this? Thanks

<apex:pageBlockTable value="{!opportunities}" var="o" rendered="{!selectedSize <> 1}">

<apex:column rendered="{!selectedSize > 1}" headerValue="Action">

<apex:outputLink value="{!URLFOR($Action.Opportunity.View, o.id)}">view</apex:outputLink>


<apex:column headerValue="Opporunity Name">

<apex:commandLink value="{!o.name}" action="{!setbubble}" status="status" rerender="thePlot,selectedBubbles">

<apex:param value="{!o.id}" name="foo" assignTo="{!selectedId}"/>



<apex:column headervalue="Account Name"><apex:outputField value="{!o.accountId}"/></apex:column>

<apex:column headerValue="Amount"><apex:outputField value="{!o.amount}"/></apex:column>

<apex:column headerValue="Stage"><apex:outputField value="{!o.stageName}"/></apex:column>

<apex:column headerValue="Probability"><apex:outputField value="{!o.probability}"/></apex:column>

<apex:column headerValue="Close Date"><apex:outputField value="{!o.closeDate}"/></apex:column>


<apex:pageBlockSection rendered="{!selectedSize == 1}">

<apex:outputField value="{!opportunity.name}"/>

<apex:outputField value="{!opportunity.account.name}"/>

<apex:outputField value="{!opportunity.probability}"/>

<apex:outputField value="{!opportunity.closeDate}"/>

<apex:outputField value="{!opportunity.amount}"/>

<apex:outputField value="{!opportunity.lastActivityDate}"/>