You need to sign in to do that
Don't have an account?
force shahid
Hi Friends, I got error as invalid type an object
Error : Invalid Type : opps__c in Apex code
Here opps is a custom object, i replace this one with standard , but also i get same error invalid type.
I fetch the data from 3 objects where the name field value is given by me. If i delete the 3rd object i got the result. Why Its not work on 3 objects.
Plz Help me guys to overcome this problem.
Visual force Page :
<apex:page controller="apmult" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title=" Enter the Value">
<apex:outputText value=" Enter Name "></apex:outputText>
<apex:inputText value="{!aname}"/>
<apex:commandButton value=" SUBMIT " action="{!save}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title=" Display Account Records ...{!lac}">
<apex:pageBlockTable value="{!arecs}" var="item">
<apex:column value="{!item.id}"/>
<apex:column value="{!item.name}"/>
<apex:column value="{!item.phone}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:pageBlockSection title=" Display Lead Records ...{!llc}">
<apex:pageBlockTable value="{!lrecs}" var="item">
<apex:column value="{!item.id}"/>
<apex:column value="{!item.name}"/>
<apex:column value="{!item.phone}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:pageBlockSection title=" Display Oops Records ...{!loc}">
<apex:pageBlockTable value="{!orecs}" var="item">
<apex:column value="{!item.id}"/>
<apex:column value="{!item.name}"/>
<apex:column value="{!item.phone}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
APEX CODE :
public class apmult {
public string aname{set;get;}
public list<account> arecs{set;get;}
public list<lead> lrecs{set;get;}
public list<opps__c> orecs{set;get;}
public integer lac{set;get;}
public integer llc{set;get;}
public integer loc{set;get;}
public void save(){
arecs=[select id,name,phone from account where name=:aname];
lac=arecs.size();
lrecs=[select id,name,phone from lead where name=:aname];
llc=lrecs.size();
orecs=[select id,name,phone from account where name=:aname];
loc=orecs.size();
}
}
I fetch the data from 3 objects where the name field value is given by me. If i delete the 3rd object i got the result. Why Its not work on 3 objects.
Plz Help me guys to overcome this problem.
Visual force Page :
<apex:page controller="apmult" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title=" Enter the Value">
<apex:outputText value=" Enter Name "></apex:outputText>
<apex:inputText value="{!aname}"/>
<apex:commandButton value=" SUBMIT " action="{!save}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title=" Display Account Records ...{!lac}">
<apex:pageBlockTable value="{!arecs}" var="item">
<apex:column value="{!item.id}"/>
<apex:column value="{!item.name}"/>
<apex:column value="{!item.phone}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:pageBlockSection title=" Display Lead Records ...{!llc}">
<apex:pageBlockTable value="{!lrecs}" var="item">
<apex:column value="{!item.id}"/>
<apex:column value="{!item.name}"/>
<apex:column value="{!item.phone}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:pageBlockSection title=" Display Oops Records ...{!loc}">
<apex:pageBlockTable value="{!orecs}" var="item">
<apex:column value="{!item.id}"/>
<apex:column value="{!item.name}"/>
<apex:column value="{!item.phone}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
APEX CODE :
public class apmult {
public string aname{set;get;}
public list<account> arecs{set;get;}
public list<lead> lrecs{set;get;}
public list<opps__c> orecs{set;get;}
public integer lac{set;get;}
public integer llc{set;get;}
public integer loc{set;get;}
public void save(){
arecs=[select id,name,phone from account where name=:aname];
lac=arecs.size();
lrecs=[select id,name,phone from lead where name=:aname];
llc=lrecs.size();
orecs=[select id,name,phone from account where name=:aname];
loc=orecs.size();
}
}
orecs=[select id,name,phone from account where name=:aname];
in the 3rd object instead of account take opps__c "orecs=[select id,name,phone from opps__c where name=:aname];"
All Answers
orecs=[select id,name,phone from account where name=:aname];
in the 3rd object instead of account take opps__c "orecs=[select id,name,phone from opps__c where name=:aname];"
But now also i got error , it shows 'opps__c' is not supported. If ur attempting the custom object be sure to append '__c' after entity. i didn't understand . i write opps__c , then y it shows error ?
Thank you Friends