4

Force.com save problem:

Save error: Invalid field ver for SObject Verifier__c

Follwing is my code

Apex Class Code

public with sharing class verifierclass{ public string applicationId {get;set;}
public verifierclass(ApexPages.StandardController stdCtrl) 
{
    this.application=(Application__c)stdCtrl.getRecord();

    lstVerifierWrapper=new List<verifierWrapper>();

    lstVerifier =[SELECT Title__c, Signature__c, Residential_Address__c, Name, Id, Date_Of_Birth__c, Application__c 
                        FROM Verifier__c
                        WHERE Application__c = : application.id];
    verifier = new Verifier__c();
}public class verifierWrapper
  {
    public Integer ident {get; private set;}        
    public Verifier__c ver {get; set;}

    public verifierWrapper(Integer inIdent,Verifier__c verifier) 
    {         
        ver=verifier;  
        ident=inIdent;   
    }
  } public PageReference AddVerifier()
{
    Verifier__c verifier;
    for(Verifier__c c1 : lstVerifier)
    {
        verifier=c1;
        verifier.Application__c = application.Id;
    }

     for (Integer idx=0; idx<addCount; idx++)   
        {    
            lstVerifierWrapper.add(new verifierWrapper(nextIdent++,verifier));   
        }

    return null;            
}   public PageReference RemoveVerifier()
{
    Integer toDelPos=-1;   
       for (Integer idx=0; idx<lstVerifierWrapper.size(); idx++)   
       {    
            if (lstVerifierWrapper[idx].ident==toDelIdent)    
            {    
                 toDelPos=idx;    
            }   
       }       
        if (-1!=toDelPos)   
        {    
          lstVerifierWrapper.remove(toDelPos);   
        }  
        return null;
}}   

Page Code:

<apex:outputPanel id="opVerifyingOfficer" rendered="{!(application.Verifying_Officer__c == 'Yes')}">
                                    <apex:pageBlock id="pbVerifyingOfficerInfo" >
                                        <apex:pageBlockSection columns="1"
                                            id="pbsVerifierOfficerInfo"
                                            title="Verifying Officer Details">
                                            <apex:inputField value="{!verifier.Name}" />
                                            <apex:inputField value="{!verifier.Title__c}" />
                                            <apex:inputField value="{!verifier.Residential_Address__c}" />
                                            <apex:inputField value="{!verifier.Date_Of_Birth__c}" />
                                            <apex:inputField value="{!verifier.Signature__c}" />
                                        </apex:pageBlockSection>
                                        <apex:outputText value="Add Verifier"
                                            style="font-weight:bold" />&nbsp;&nbsp;
<apex:commandButton value="Add" action="{!AddVerifier}"
                                            rerender="pbsVerifyingOfficerInfo">
                                            <apex:param name="addCount" value="1" assignTo="{!addCount}" />
                                        </apex:commandButton>

                                        <br />
                                        <br />
                                        <apex:repeat value="{!lstVerifierWrapper}"
                                            var="verifier">
                                            <apex:pageBlockSection columns="1"
                                                id="pbsVerifierOfficerInfo"
                                                title="Verifying Officer Details">
                                                <apex:inputField value="{!verifier.ver.Name}" />
                                                <apex:inputField value="{!verifier.ver.Title__c}" />

                                                <apex:commandButton value="Remove"
                                                    action="{!RemoveVerifier}"
                                                    rerender="pbsVerifyingOfficerInfo">
                                                    <apex:param name="toDelIdent" value="{!verifier.ident}"
                                                        assignTo="{!toDelIdent}" />
                                                </apex:commandButton>
                                            </apex:pageBlockSection>  
                                        </apex:repeat>
                                        </apex:pageBlock>
                                        </apex:outputPanel>
6
  • 1
    Please be more specific. Where does the error occur? Where is the save method? What have you tried to fix the error? Oct 11 '13 at 8:21
  • When i save my visualforce page... i get this error its not giving me to save the page... ami clear
    – TestNS
    Oct 11 '13 at 8:26
  • 1
    To what extend do you try to solve things yourself ? All of your questions of the past days show little effort or trying to understand solving the problem. While we can appriciate you're trying to learn and make progress, there may be a point at which the community is no longer motivated to help you out like this. Oct 11 '13 at 8:33
  • I am trying my level best in undertanding the things.. but if this is not the right coomunity to ask such question. I wont proceed further..thanks for all the help that i got so far...
    – TestNS
    Oct 11 '13 at 8:48
  • You can keep posting questions, but maybe a good guidline is that you fist spend maybe 15-30 minutes troubleshooting the problem yourself. If you're unclear where specifically the problem is, you could for instance comment out parts of your code untill you know what part is giving errors and have a look at that. Oct 11 '13 at 8:53
4

Try using a different repeat var name.

Your Visualforce:

<apex:repeat value="{!lstVerifierWrapper}" var="verifier">
          <apex:pageBlockSection columns="1" id="pbsVerifierOfficerInfo" title="Verifying Officer Details">
                   <apex:inputField value="{!verifier.ver.Name}" />
                   <apex:inputField value="{!verifier.ver.Title__c}" />

In your apex constructure:

verifier = new Verifier__c();

I can't make out where that variable is declared, but I believe you have declared it as class variable and your Visualforce is trying to access that rather than the repeat var.

(could be wrong but this is the first thing that I think could be the issue)

1
  • Yes.. i was refering the object variable.. and hence getting the error.. thanks i change the repeat value varieable to "verifiers".. Thanks Sdry
    – TestNS
    Oct 11 '13 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.