Skip to main content
formatting
Source Link
crmprogdev
  • 41k
  • 9
  • 58
  • 116

My query is when I input account details after that input contact detail and click on the save button its not save given error is Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [AccountId]

Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [AccountId]*

My query is when I input account details after that input contact detail and click on the save button its not save given error is Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [AccountId]

My query is when I input account details after that input contact detail and click on the save button its not save given error is

Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [AccountId]*

Please do not use unnecessary spaces in the code, and caps.
Source Link

Insert PArentParent and multiple child record with same vfpagevf page

My query is when iI input account details after that input contact detail and click on the save button its not save given error is Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [AccountId]

public class AccountContactController{
 
public Account acc{get;set;}
public List<Contact> cont{get;set;}
public AccountContactController(){
    acc = new Account();
    cont = new List<Contact>();
    AddRow();
    AddRow();
    AddRow();

}
public void AddRow(){
    cont.add(new Contact());

}
 
public void save(){
    if(acc.name != null){
        insert acc;
        List<contact> con = new List<contact>();
        for(Contact c : cont){
            c.AccountId = acc.id;
            con.add(c);
        
        }
        if(con != null){
            insert con;
        }
        
    
    
    }

}}

}

Insert PArent and multiple child record with same vfpage

My query is when i input account details after that input contact detail and click on the save button its not save given error is Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [AccountId]

public class AccountContactController{
 
public Account acc{get;set;}
public List<Contact> cont{get;set;}
public AccountContactController(){
    acc = new Account();
    cont = new List<Contact>();
    AddRow();
    AddRow();
    AddRow();

}
public void AddRow(){
    cont.add(new Contact());

}
 
public void save(){
    if(acc.name != null){
        insert acc;
        List<contact> con = new List<contact>();
        for(Contact c : cont){
            c.AccountId = acc.id;
            con.add(c);
        
        }
        if(con != null){
            insert con;
        }
        
    
    
    }

}

}

Insert Parent and multiple child record with same vf page

My query is when I input account details after that input contact detail and click on the save button its not save given error is Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [AccountId]

public class AccountContactController{
public Account acc{get;set;}
public List<Contact> cont{get;set;}
public AccountContactController(){
    acc = new Account();
    cont = new List<Contact>();
    AddRow();
    AddRow();
    AddRow();

}
public void AddRow(){
    cont.add(new Contact());

}
public void save(){
    if(acc.name != null){
        insert acc;
        List<contact> con = new List<contact>();
        for(Contact c : cont){
            c.AccountId = acc.id;
            con.add(c);
        
        }
        if(con != null){
            insert con;
        }
    }

}}
added 12 characters in body
Source Link
cloudZigZag
  • 1.4k
  • 3
  • 31
  • 81
  <apex:page controller="AccountContactController">

<apex:form > <apex:pageBlock > <apex:pageblocksection columns="2"> <apex:inputField value="{!acc.name}"/> <apex:inputField value="{!acc.phone}"/> <apex:inputField value="{!acc.website}"/> <apex:inputField value="{!acc.Sic}"/>

  <apex:form >
      <apex:pageBlock >
        <apex:pageblocksection columns="2">
        <apex:inputField value="{!acc.name}"/>
        <apex:inputField value="{!acc.phone}"/>
        <apex:inputField value="{!acc.website}"/>
        <apex:inputField value="{!acc.Sic}"/>
    
    </apex:pageblocksection>      
    <apex:pageBlockSection columns="1">
        <apex:pageBlockTable value="{!cont}" var="contacts">
            <apex:column headerValue="First Name">
                <apex:inputField value="{!contacts.firstname}"/>
            </apex:column>
            <apex:column headerValue="Last Name">
                <apex:inputField value="{!contacts.lastname}"/>
            </apex:column>
            <apex:column headerValue="Email">
                <apex:inputField value="{!contacts.email}"/>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
   <apex:pageBlockButtons >
    <apex:commandButton value="Save" action="{!save}"/>
    <apex:commandButton value="Add Row" action="{!AddRow}" immediate="true"/>
    </apex:pageBlockButtons>
  
  </apex:pageBlock> 
  <apex:page controller="AccountContactController">

<apex:form > <apex:pageBlock > <apex:pageblocksection columns="2"> <apex:inputField value="{!acc.name}"/> <apex:inputField value="{!acc.phone}"/> <apex:inputField value="{!acc.website}"/> <apex:inputField value="{!acc.Sic}"/>

    </apex:pageblocksection>      
    <apex:pageBlockSection columns="1">
        <apex:pageBlockTable value="{!cont}" var="contacts">
            <apex:column headerValue="First Name">
                <apex:inputField value="{!contacts.firstname}"/>
            </apex:column>
            <apex:column headerValue="Last Name">
                <apex:inputField value="{!contacts.lastname}"/>
            </apex:column>
            <apex:column headerValue="Email">
                <apex:inputField value="{!contacts.email}"/>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
   <apex:pageBlockButtons >
    <apex:commandButton value="Save" action="{!save}"/>
    <apex:commandButton value="Add Row" action="{!AddRow}" immediate="true"/>
    </apex:pageBlockButtons>
  
  </apex:pageBlock> 
  <apex:page controller="AccountContactController">
  <apex:form >
      <apex:pageBlock >
        <apex:pageblocksection columns="2">
        <apex:inputField value="{!acc.name}"/>
        <apex:inputField value="{!acc.phone}"/>
        <apex:inputField value="{!acc.website}"/>
        <apex:inputField value="{!acc.Sic}"/>
    
    </apex:pageblocksection>      
    <apex:pageBlockSection columns="1">
        <apex:pageBlockTable value="{!cont}" var="contacts">
            <apex:column headerValue="First Name">
                <apex:inputField value="{!contacts.firstname}"/>
            </apex:column>
            <apex:column headerValue="Last Name">
                <apex:inputField value="{!contacts.lastname}"/>
            </apex:column>
            <apex:column headerValue="Email">
                <apex:inputField value="{!contacts.email}"/>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
   <apex:pageBlockButtons >
    <apex:commandButton value="Save" action="{!save}"/>
    <apex:commandButton value="Add Row" action="{!AddRow}" immediate="true"/>
    </apex:pageBlockButtons>
  
  </apex:pageBlock> 
visualforce page
Source Link
cloudZigZag
  • 1.4k
  • 3
  • 31
  • 81
Loading
Source Link
cloudZigZag
  • 1.4k
  • 3
  • 31
  • 81
Loading