-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
33Questions
-
23Replies
Issue in pagination
hi
Iam using custom controller my requriment is when iam entering feilds in vfpage using input componnent record has to be saved to database and fetch all the details records from database and didplay in pageblock table.And in same page iam included pagination and when iam click on firstpage it has to be display first 10 records from database and secondpage next 10 records and lastpage remaining records so i tried for below code and page records are displaying after saving but not working pagination part here below you find my code
public with sharing class task2Pagination {
public ajay_ambati_2__Candidate1__c can{get;set;}
public List<ajay_ambati_2__Candidate1__c> canlst {get;set;}
public boolean Popup {get; set;}
Public Integer noOfRecords {get; set;}
Public Integer size {get;set;}
public task2Pagination (){
can = new ajay_ambati_2__Candidate1__c();
canlst = new list<ajay_ambati_2__Candidate1__c>();
canlst = [Select Name,ajay_ambati_2__Age__c,ajay_ambati_2__Gender__c,ajay_ambati_2__Salary__c from ajay_ambati_2__Candidate1__c Order By Name];
}
public void closePopup() {
Popup = false;
}
public PageReference Save() {
insert can;
Popup = true;
return null;
}
/* public PageReference fetchDetails(){
empList = [Select Name,ajay_ambati_2__Age__c,ajay_ambati_2__Gender__c,ajay_ambati_2__Salary__c from ajay_ambati_2__Candidate1__c Order By Name];
System.debug('Employee details'+empList );
return null;
}*/
public ApexPages.StandardSetController Con {
get{
if(Con == null){
size = 10;
string queryString = 'Select Name, ajay_ambati_2__Age__c,ajay_ambati_2__Gender__c,ajay_ambati_2__Salary__c from ajay_ambati_2__Candidate1__c order by Name';
Con = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
Con.setPageSize(size);
// System.debug('<<size>>'+size);
noOfRecords = Con.getResultSize();
System.debug('<<NoOf Records>>'+noOfRecords);
}
return Con;
}set;
}
/* Public List<Eployee__c> getEployees(){
List<Eployee__c> empList = new List<Eployee__c>();
for(Eployee__c a : (List<Eployee__c>)setCon.getRecords())
empList.add(a);
empList.sort();
return empList;
}*/
/* public pageReference refresh() {
setCon = null;
getEployees();
setCon.setPageNumber(1);
return null;
}*/
public Boolean hasNext1 {
get {
return Con.getHasNext();
}
set;
}
public Boolean hasPrevious1 {
get {
return Con.getHasPrevious();
}
set;
}
public Integer pageNumber {
get {
return Con.getPageNumber();
}
set;
}
public void first() {
Con.first();
}
public void last() {
Con.last();
}
public void previous() {
Con.previous();
}
public void next() {
Con.next();
}
}
______________________________DONT CONFUSE IAM USING SLDC IN VISUAL FORCE PAGE _______________________
<apex:page showHeader="false" sidebar="false" standardStylesheets="true" Controller="task2Pagination" >
<apex:form >
<apex:pageMessages />
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<apex:slds />
</head>
<body class="slds-scope" >
<div class="slds-media__figure" >
<svg aria-hidden="true" class="slds-icon slds-icon-standard-contact">
<use xlink:href="{!URLFOR($Asset.SLDS, '/assets/icons/standard-sprite/svg/symbols.svg#contact')}"></use>
</svg> EDIT CANDIDATE
</div>
<div class="slds-form-element slds-hint-parent" scope="col">
<span class="slds-form-element__label"><strong></strong>Name</span>
<div class="slds-form-element__control">
<apex:inputField styleClass="slds-input" value="{!can.Name}" style="width:57%; line-height:1.875em;" />
</div>
</div>
<div class="slds-form-element slds-hint-parent" >
<span class="slds-form-element__label"><strong></strong>Gender</span>
<div class="slds-form-element__control" >
<apex:inputField styleClass="slds-input" value="{!can.Gender__c}" style="width:10% ; line-height:75em;"/>
</div>
</div>
<div class="slds-form-element slds-hint-parent" >
<span class="slds-form-element__label"><strong></strong>Age</span>
<div class="slds-form-element__control" >
<apex:inputField styleClass="slds-input" value="{!can.Age__c}" style="width:57%; line-height:1.875em;"/>
</div>
</div>
<div class="slds-form-element slds-hint-parent" >
<span class="slds-form-element__label"><strong></strong>Salary</span>
<div class="slds-form-element__control" >
<apex:inputField styleClass="slds-input" value="{!can.Salary__c}" style="width:57%; line-height:1.875em;"/>
</div>
</div>
<div class="slds-p-horizontal--small slds-m-top--medium slds-size--1-of-1 slds-align--absolute-center">
<apex:commandButton styleClass="slds-button slds-button--brand" value="Save" action="{!save}" />
</div>
<apex:outputPanel id="myPanel">
<table cellspacing="3" cellpadding="3" class="slds-table slds-table_bordered slds-table_cell-buffer" styleclass="">
<tr >
<th width="30%"> Name</th>
<th width="15%"> Gender</th>
<th width="30%">Age</th>
<th width="30%">Salary</th>
</tr>
<apex:repeat value="{!canlst}" var="a">
<tr >
<td >
<apex:outputField value="{!a.Name}" />
</td>
<td>
<apex:outputField value="{!a.Age__c}" />
</td>
<td >
<apex:outputField value="{!a.Gender__c}" />
</td>
<td >
<apex:outputField value="{!a.Salary__c}" />
</td>
</tr></apex:repeat>
</table>
</apex:outputPanel>
<div class="slds-p-horizontal--small slds-m-top--medium slds-size--1-of-1 slds-align--absolute-center">
<apex:commandButton styleClass="slds-button slds-button--brand" value="firstpage" action="{!first}" />
<apex:commandButton styleClass="slds-button slds-button--brand" value="lastpage" action="{!last}"/>
<apex:commandButton styleClass="slds-button slds-button--brand" value="previouspage" action="{!previous}" />
<apex:commandButton styleClass="slds-button slds-button--brand" value="nextpage" action="{!next}" />
</div>
</body>
</html>
</apex:form>
</apex:page>
Iam using custom controller my requriment is when iam entering feilds in vfpage using input componnent record has to be saved to database and fetch all the details records from database and didplay in pageblock table.And in same page iam included pagination and when iam click on firstpage it has to be display first 10 records from database and secondpage next 10 records and lastpage remaining records so i tried for below code and page records are displaying after saving but not working pagination part here below you find my code
public with sharing class task2Pagination {
public ajay_ambati_2__Candidate1__c can{get;set;}
public List<ajay_ambati_2__Candidate1__c> canlst {get;set;}
public boolean Popup {get; set;}
Public Integer noOfRecords {get; set;}
Public Integer size {get;set;}
public task2Pagination (){
can = new ajay_ambati_2__Candidate1__c();
canlst = new list<ajay_ambati_2__Candidate1__c>();
canlst = [Select Name,ajay_ambati_2__Age__c,ajay_ambati_2__Gender__c,ajay_ambati_2__Salary__c from ajay_ambati_2__Candidate1__c Order By Name];
}
public void closePopup() {
Popup = false;
}
public PageReference Save() {
insert can;
Popup = true;
return null;
}
/* public PageReference fetchDetails(){
empList = [Select Name,ajay_ambati_2__Age__c,ajay_ambati_2__Gender__c,ajay_ambati_2__Salary__c from ajay_ambati_2__Candidate1__c Order By Name];
System.debug('Employee details'+empList );
return null;
}*/
public ApexPages.StandardSetController Con {
get{
if(Con == null){
size = 10;
string queryString = 'Select Name, ajay_ambati_2__Age__c,ajay_ambati_2__Gender__c,ajay_ambati_2__Salary__c from ajay_ambati_2__Candidate1__c order by Name';
Con = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
Con.setPageSize(size);
// System.debug('<<size>>'+size);
noOfRecords = Con.getResultSize();
System.debug('<<NoOf Records>>'+noOfRecords);
}
return Con;
}set;
}
/* Public List<Eployee__c> getEployees(){
List<Eployee__c> empList = new List<Eployee__c>();
for(Eployee__c a : (List<Eployee__c>)setCon.getRecords())
empList.add(a);
empList.sort();
return empList;
}*/
/* public pageReference refresh() {
setCon = null;
getEployees();
setCon.setPageNumber(1);
return null;
}*/
public Boolean hasNext1 {
get {
return Con.getHasNext();
}
set;
}
public Boolean hasPrevious1 {
get {
return Con.getHasPrevious();
}
set;
}
public Integer pageNumber {
get {
return Con.getPageNumber();
}
set;
}
public void first() {
Con.first();
}
public void last() {
Con.last();
}
public void previous() {
Con.previous();
}
public void next() {
Con.next();
}
}
______________________________DONT CONFUSE IAM USING SLDC IN VISUAL FORCE PAGE _______________________
<apex:page showHeader="false" sidebar="false" standardStylesheets="true" Controller="task2Pagination" >
<apex:form >
<apex:pageMessages />
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<apex:slds />
</head>
<body class="slds-scope" >
<div class="slds-media__figure" >
<svg aria-hidden="true" class="slds-icon slds-icon-standard-contact">
<use xlink:href="{!URLFOR($Asset.SLDS, '/assets/icons/standard-sprite/svg/symbols.svg#contact')}"></use>
</svg> EDIT CANDIDATE
</div>
<div class="slds-form-element slds-hint-parent" scope="col">
<span class="slds-form-element__label"><strong></strong>Name</span>
<div class="slds-form-element__control">
<apex:inputField styleClass="slds-input" value="{!can.Name}" style="width:57%; line-height:1.875em;" />
</div>
</div>
<div class="slds-form-element slds-hint-parent" >
<span class="slds-form-element__label"><strong></strong>Gender</span>
<div class="slds-form-element__control" >
<apex:inputField styleClass="slds-input" value="{!can.Gender__c}" style="width:10% ; line-height:75em;"/>
</div>
</div>
<div class="slds-form-element slds-hint-parent" >
<span class="slds-form-element__label"><strong></strong>Age</span>
<div class="slds-form-element__control" >
<apex:inputField styleClass="slds-input" value="{!can.Age__c}" style="width:57%; line-height:1.875em;"/>
</div>
</div>
<div class="slds-form-element slds-hint-parent" >
<span class="slds-form-element__label"><strong></strong>Salary</span>
<div class="slds-form-element__control" >
<apex:inputField styleClass="slds-input" value="{!can.Salary__c}" style="width:57%; line-height:1.875em;"/>
</div>
</div>
<div class="slds-p-horizontal--small slds-m-top--medium slds-size--1-of-1 slds-align--absolute-center">
<apex:commandButton styleClass="slds-button slds-button--brand" value="Save" action="{!save}" />
</div>
<apex:outputPanel id="myPanel">
<table cellspacing="3" cellpadding="3" class="slds-table slds-table_bordered slds-table_cell-buffer" styleclass="">
<tr >
<th width="30%"> Name</th>
<th width="15%"> Gender</th>
<th width="30%">Age</th>
<th width="30%">Salary</th>
</tr>
<apex:repeat value="{!canlst}" var="a">
<tr >
<td >
<apex:outputField value="{!a.Name}" />
</td>
<td>
<apex:outputField value="{!a.Age__c}" />
</td>
<td >
<apex:outputField value="{!a.Gender__c}" />
</td>
<td >
<apex:outputField value="{!a.Salary__c}" />
</td>
</tr></apex:repeat>
</table>
</apex:outputPanel>
<div class="slds-p-horizontal--small slds-m-top--medium slds-size--1-of-1 slds-align--absolute-center">
<apex:commandButton styleClass="slds-button slds-button--brand" value="firstpage" action="{!first}" />
<apex:commandButton styleClass="slds-button slds-button--brand" value="lastpage" action="{!last}"/>
<apex:commandButton styleClass="slds-button slds-button--brand" value="previouspage" action="{!previous}" />
<apex:commandButton styleClass="slds-button slds-button--brand" value="nextpage" action="{!next}" />
</div>
</body>
</html>
</apex:form>
</apex:page>
-
- ajay ambati
- May 18, 2018
- Like
- 0
- Continue reading or reply
visualforce page issue on save button with update operation
hi my requirement is placed 4 buttons 3 buttons display list of accounts,contacts,oppurtunitys when iam clicking,I need to update my feilds from visualforcepage by using CUSTOM CONTROLLER and inline edit support but when iam click save button its need to update but it is not working getting "Nullpointer exception"
please solve this
below is vfpage:
<apex:page controller="all12">
<apex:form >
<style>
.accountstyle
{
background-color:yellow;
font-weight:bold;
color:#E56717;
}
</style>
<apex:pageBlock >
<apex:commandButton value="listofaccounts" action="{!sss}" />
<apex:commandButton value="listofopp" action="{!ddd}"/>
<apex:commandButton value="listofcontacts" action="{!fff}"/>
<apex:commandButton value="saveit" action="{!save}"/>
<apex:pageBlockTable value="{!lst1}" var="a" rendered="{!show}">
<apex:column value="{!a.name}"/>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!opp}" var="o" rendered="{!show1}" >
<apex:column value="{!o.Name}" styleClass="accountstyle"/>
<apex:column value="{!o.CloseDate}"/>
<apex:column value="{!o.StageName }"/>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!cnt}" var="x" rendered="{!show2}">
<apex:column value="{!x.Name}"/>
<apex:inlineEditSupport />
</apex:pageBlockTable>
<apex:inlineEditSupport event="ondblclick"/>
</apex:pageBlock>
</apex:form>
</apex:page>
controller: Note this is custom controller not the standard controller please say solution for controller not for the standard controller using
controller:
public class all12 {
public boolean show {get;set;}
public boolean show1 {get;set;}
public boolean show2 {get;set;}
public String lst { get; set; }
public list<account> lst1 {get;set;}
public list<Opportunity> opp {get;set;}
public list<schema.contact> cnt {get;set;}
public account ac{get;set;}
// public id ids{get;set;}
public PageReference sss()
{
show = true;
show1 = false;
show2 = false;
lst1 = [select id, name from account ];
return null;
}
public PageReference fff()
{
show = false;
show1 = false;
show2 = true;
cnt=[select name,phone from contact];
return null;
}
public PageReference ddd()
{
show = false;
show1 = true;
show2 = false;
opp = [select Name,CloseDate,StageName from opportunity];
return null;
}
public PageReference save()
{
ac = [select id,name from account where id=:ac.id];
lst1.add(ac);
//lst1.add(ii);
update lst1;
//update opp ;
//update cnt;
return null;
}
}
please solve this
below is vfpage:
<apex:page controller="all12">
<apex:form >
<style>
.accountstyle
{
background-color:yellow;
font-weight:bold;
color:#E56717;
}
</style>
<apex:pageBlock >
<apex:commandButton value="listofaccounts" action="{!sss}" />
<apex:commandButton value="listofopp" action="{!ddd}"/>
<apex:commandButton value="listofcontacts" action="{!fff}"/>
<apex:commandButton value="saveit" action="{!save}"/>
<apex:pageBlockTable value="{!lst1}" var="a" rendered="{!show}">
<apex:column value="{!a.name}"/>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!opp}" var="o" rendered="{!show1}" >
<apex:column value="{!o.Name}" styleClass="accountstyle"/>
<apex:column value="{!o.CloseDate}"/>
<apex:column value="{!o.StageName }"/>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!cnt}" var="x" rendered="{!show2}">
<apex:column value="{!x.Name}"/>
<apex:inlineEditSupport />
</apex:pageBlockTable>
<apex:inlineEditSupport event="ondblclick"/>
</apex:pageBlock>
</apex:form>
</apex:page>
controller: Note this is custom controller not the standard controller please say solution for controller not for the standard controller using
controller:
public class all12 {
public boolean show {get;set;}
public boolean show1 {get;set;}
public boolean show2 {get;set;}
public String lst { get; set; }
public list<account> lst1 {get;set;}
public list<Opportunity> opp {get;set;}
public list<schema.contact> cnt {get;set;}
public account ac{get;set;}
// public id ids{get;set;}
public PageReference sss()
{
show = true;
show1 = false;
show2 = false;
lst1 = [select id, name from account ];
return null;
}
public PageReference fff()
{
show = false;
show1 = false;
show2 = true;
cnt=[select name,phone from contact];
return null;
}
public PageReference ddd()
{
show = false;
show1 = true;
show2 = false;
opp = [select Name,CloseDate,StageName from opportunity];
return null;
}
public PageReference save()
{
ac = [select id,name from account where id=:ac.id];
lst1.add(ac);
//lst1.add(ii);
update lst1;
//update opp ;
//update cnt;
return null;
}
}
-
- ajay ambati
- June 09, 2017
- Like
- 0
- Continue reading or reply
trigger issue while updating existing records
iam ajay iam having contacts are not associated with accounts iam goal is if contact not having accountname i,e lookup feild in contact so, i need to give accountname i,e SONY which having in existing accounts for all contacts so iam trying but recurssive trigger error iam finding to avoid yhat iam created class with boolean static variable and accesed in trigger yhat you can found below
CLASS:
public class avoidrecurssive
{
public static boolean firstrun=true;
}
TRIGGER:
trigger childtoparent on Contact (before update)
{
if(trigger.isbefore)
{
if(trigger.isupdate)
{
list<schema.contact> c = new list<schema.contact>();
account a = [select id,name from account where name ='sony'];
c=[select id,name,accountid from contact where accountid = null ];
for(schema.contact cn:c)
{
if(avoidrecurssive.firstrun)
{
avoidrecurssive.firstrun=false;
cn.Accountid = a.id;
update cn;
}
}
}
}
}
SCRRENSHOT OF ERROR:
while updating existing contacts
CLASS:
public class avoidrecurssive
{
public static boolean firstrun=true;
}
TRIGGER:
trigger childtoparent on Contact (before update)
{
if(trigger.isbefore)
{
if(trigger.isupdate)
{
list<schema.contact> c = new list<schema.contact>();
account a = [select id,name from account where name ='sony'];
c=[select id,name,accountid from contact where accountid = null ];
for(schema.contact cn:c)
{
if(avoidrecurssive.firstrun)
{
avoidrecurssive.firstrun=false;
cn.Accountid = a.id;
update cn;
}
}
}
}
}
SCRRENSHOT OF ERROR:
while updating existing contacts
-
- ajay ambati
- April 30, 2017
- Like
- 0
- Continue reading or reply
lightning issue on enabling
iam finding below error while iam enabiling the lightning in my developer account
-
- ajay ambati
- March 15, 2017
- Like
- 0
- Continue reading or reply
Issue on visualforce page
Iam developed one vfpage using custom controller.In this my requiremnt is retrieve all parent records(account related) in one pageblock table and all childrecords(contact related ) in one pgblocktable.so i done with this and its working iam retriving rcords of both but my another requiremnt is iam placed another button for save the records its not working iam getting error and also iam used inlineedit in this but not working below is my code
vfpage:
<apex:page controller="soql1" showHeader="false" >
<apex:form >
<apex:pageBlock title="listofparentrecordsacc" >
<apex:pageBlockButtons location="top" >
<apex:commandButton value="listofaccountsparent" action="{!myparentrecords}" />
<apex:commandButton value="listofcontactchid" action="{!mychildrecords}" />
<apex:commandButton value="save" action="{!save}" />
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!lst}" var="a" rendered="{!show}" >
<apex:column value="{!a.name}"/>
<apex:column value="{!a.industry}"/>
<apex:column headerValue="contacts">
<apex:repeat value="{!a.contacts}" var="b">
{!b.firstname}<br/>
</apex:repeat>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!cnt}" var="c" rendered="{!show1}">
<apex:column value="{!c.firstname}"/>
<apex:column value="{!c.lastname}"/>
<apex:column value="{!c.account.name}"/>
</apex:pageBlockTable>
<apex:inlineEditSupport />
<apex:pageblockTable value="{!lst1}" var="s">
<apex:column value="{!s.name}"/>
<apex:column value="{!s.industry}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
controller:
public class soql1
{
public string na {get;set;}
public string ind {get;set;}
public list<account> lst2 {get;set;}
public boolean show {get;set;}
public boolean show1 {get;set;}
public list<account> lst {get;set;}
public list<account> lst1 {get;set;}
public list<schema.contact> cnt{get;set;}
public void myparentrecords()
{
show=true;
show1=false;
lst=[select id,name,industry,(select id,firstname from contacts)from account];
}
public void mychildrecords()
{
show=false;
show1=true;
cnt=[select id,firstname,lastname,account.name from contact];
}
public PageReference save(){
account a=new account();
a.Name=na;
a.industry=ind;
// lst2 = [select id,name,industry from account ];
//if(a.name =='')
//{
//a.name=na;
lst1.add(a);
//}
insert lst1;
return null;
}
}
vfpage:
<apex:page controller="soql1" showHeader="false" >
<apex:form >
<apex:pageBlock title="listofparentrecordsacc" >
<apex:pageBlockButtons location="top" >
<apex:commandButton value="listofaccountsparent" action="{!myparentrecords}" />
<apex:commandButton value="listofcontactchid" action="{!mychildrecords}" />
<apex:commandButton value="save" action="{!save}" />
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!lst}" var="a" rendered="{!show}" >
<apex:column value="{!a.name}"/>
<apex:column value="{!a.industry}"/>
<apex:column headerValue="contacts">
<apex:repeat value="{!a.contacts}" var="b">
{!b.firstname}<br/>
</apex:repeat>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!cnt}" var="c" rendered="{!show1}">
<apex:column value="{!c.firstname}"/>
<apex:column value="{!c.lastname}"/>
<apex:column value="{!c.account.name}"/>
</apex:pageBlockTable>
<apex:inlineEditSupport />
<apex:pageblockTable value="{!lst1}" var="s">
<apex:column value="{!s.name}"/>
<apex:column value="{!s.industry}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
controller:
public class soql1
{
public string na {get;set;}
public string ind {get;set;}
public list<account> lst2 {get;set;}
public boolean show {get;set;}
public boolean show1 {get;set;}
public list<account> lst {get;set;}
public list<account> lst1 {get;set;}
public list<schema.contact> cnt{get;set;}
public void myparentrecords()
{
show=true;
show1=false;
lst=[select id,name,industry,(select id,firstname from contacts)from account];
}
public void mychildrecords()
{
show=false;
show1=true;
cnt=[select id,firstname,lastname,account.name from contact];
}
public PageReference save(){
account a=new account();
a.Name=na;
a.industry=ind;
// lst2 = [select id,name,industry from account ];
//if(a.name =='')
//{
//a.name=na;
lst1.add(a);
//}
insert lst1;
return null;
}
}
-
- ajay ambati
- March 13, 2017
- Like
- 0
- Continue reading or reply
reevalute workflow
what is the use of re-evalute workflow after feild change checkbox? why we use please give me one example
-
- ajay ambati
- March 08, 2017
- Like
- 0
- Continue reading or reply
soql not retriving record from parent object
1,hi,iam having two objects oppurtunity(parent) and another is custom object name is TopXDesignation__c(child) having MDR RELATIONSHIP and i want to retrieve records from parent i,e opportunity so, i wriiten soql query below
lstopp=[select id,Name,CloseDate,StageName,(select id,name,Document_Attached__c from TopXDesignation__r) from Opportunity];
but iam getting below error:
Didn't understand relationship 'aTopXDesignation__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
2,and also iam tried follwing type query not geeting
lstopp=[select id,Name,CloseDate,StageName,(select id,TopXDesignation__c.name,TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r) from Opportunity];
ERROR IS :
TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r)
^
ERROR at Row:1:Column:116
Didn't understand relationship 'TopXDesignation__c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
PLEASE ANSWER IT
lstopp=[select id,Name,CloseDate,StageName,(select id,name,Document_Attached__c from TopXDesignation__r) from Opportunity];
but iam getting below error:
Didn't understand relationship 'aTopXDesignation__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
2,and also iam tried follwing type query not geeting
lstopp=[select id,Name,CloseDate,StageName,(select id,TopXDesignation__c.name,TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r) from Opportunity];
ERROR IS :
TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r)
^
ERROR at Row:1:Column:116
Didn't understand relationship 'TopXDesignation__c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
PLEASE ANSWER IT
-
- ajay ambati
- September 30, 2016
- Like
- 0
- Continue reading or reply
trigger not firing on chekbox feild i
i am entering new values in account if phone is anything in account that must be same related contact phone and create related contact for that account.so its firing. but, after this i want to check the checkbox field in account thats not firing pls hlp me
trigger creatingcasebasedonaccounttrigger on Account (after insert)
{
list<schema.contact> lst = new list<schema.contact>();
list<account> gh = new list<account>();
list<Id> listIds = new List<Id>();
//schema.accc=new schema.contact();
if(trigger.isafter)
{
if(trigger.isinsert)
{
for(account acc:trigger.new)
{
System.debug('@@@@id is: ' + acc.Id);
System.debug('####name is : ' + acc.Name);
if(acc.phone !=null)
{
schema.contact cs = new schema.contact();
//cs.Account=acc.Name;
cs.lastname=acc.name;
//cs.closed Date='';
cs.accountid =acc.id;
cs.phone=acc.phone;
cs.contactrelaioncheckbox__c=true;
lst.add(cs);
}
}
}
//acc.CHECKEDACCOUNT__c=true;
insert lst;
list<account> lk =[select id,name,CHECKEDACCOUNT__c from account where id in:listIds];
for(account an:lk)
{
an.CHECKEDACCOUNT__c=true;
gh.add(an);
}
}
update gh;
}
trigger creatingcasebasedonaccounttrigger on Account (after insert)
{
list<schema.contact> lst = new list<schema.contact>();
list<account> gh = new list<account>();
list<Id> listIds = new List<Id>();
//schema.accc=new schema.contact();
if(trigger.isafter)
{
if(trigger.isinsert)
{
for(account acc:trigger.new)
{
System.debug('@@@@id is: ' + acc.Id);
System.debug('####name is : ' + acc.Name);
if(acc.phone !=null)
{
schema.contact cs = new schema.contact();
//cs.Account=acc.Name;
cs.lastname=acc.name;
//cs.closed Date='';
cs.accountid =acc.id;
cs.phone=acc.phone;
cs.contactrelaioncheckbox__c=true;
lst.add(cs);
}
}
}
//acc.CHECKEDACCOUNT__c=true;
insert lst;
list<account> lk =[select id,name,CHECKEDACCOUNT__c from account where id in:listIds];
for(account an:lk)
{
an.CHECKEDACCOUNT__c=true;
gh.add(an);
}
}
update gh;
}
-
- ajay ambati
- September 23, 2016
- Like
- 0
- Continue reading or reply
interview based question
1,how many soql queries allowed in trigger not in apex class?
2,can we process one record in batch apex class?
2,can we process one record in batch apex class?
-
- ajay ambati
- June 29, 2016
- Like
- 0
- Continue reading or reply
error while retriveing 100000 records in vfpage
Retrieving more than 100.000 records using select statement in visual force how can it possible?pls help me with exact soql query? but soql support only 50000 rows please hlp me.
-
- ajay ambati
- June 26, 2016
- Like
- 0
- Continue reading or reply
updating multiple records from child to parent in anonymous window hlp me plssss
iam executing this code in anonymous block iam getting error like my requirment is only in anonumos window
Line: 35, Column: 1
System.ListException: Duplicate id in list: 00128000003LLRkAAO
OK
pls hlp me
:*the following below is my code:*
list<account> lst1 = new list<account>();
list<schema.contact> lst = [select id,name,account.name,account.Fax from contact where account.Fax != null];
for(schema.contact c:lst)
{
system.debug('DISPLAY'+c.account.name);
system.debug('@@@@@@'+c.account.Fax);
//Account ac = [select id,name,fax from account where id=:c.account.id];
c.account.Fax='040-567-234';
lst1.add(c.account);
}
update lst1;
Line: 35, Column: 1
System.ListException: Duplicate id in list: 00128000003LLRkAAO
OK
pls hlp me
:*the following below is my code:*
list<account> lst1 = new list<account>();
list<schema.contact> lst = [select id,name,account.name,account.Fax from contact where account.Fax != null];
for(schema.contact c:lst)
{
system.debug('DISPLAY'+c.account.name);
system.debug('@@@@@@'+c.account.Fax);
//Account ac = [select id,name,fax from account where id=:c.account.id];
c.account.Fax='040-567-234';
lst1.add(c.account);
}
update lst1;
-
- ajay ambati
- June 02, 2016
- Like
- 0
- Continue reading or reply
-
- ajay ambati
- May 24, 2016
- Like
- 0
- Continue reading or reply
security error
while manual sharing the record to another user what is the backend operation it performs?pls explain
-
- ajay ambati
- May 19, 2016
- Like
- 0
- Continue reading or reply
batch apex error
iam new to the batch apex.here my question is batch apex job in exeute method iam passing list of accounts i,e 50,000 record ascynchronously and only 30,000 records inserted and remaining failed so,how to recognize the filed records where you found and how to reprocess that failed records?
-
- ajay ambati
- May 12, 2016
- Like
- 0
- Continue reading or reply
error in @future method
iam having list of account records and i want to pass in @FUTURE method is it possible or not? if not possible how can you pass the records with neat explanation i want step-wise procedure pls hlp me
-
- ajay ambati
- May 12, 2016
- Like
- 0
- Continue reading or reply
error in writing class
iam getting this Error: Compile Error: Variable does not exist: account at line 10 column 3
public class my
{
public void my1()
{
list<schema.contact> lst = [Select id,name,account.name,account.Phone from contact where Phone=null];
for(contact c:lst)
{
c.account.phone='9177818131';
update c.account;
}
}
}
i will cal above method in anonymous block
public class my
{
public void my1()
{
list<schema.contact> lst = [Select id,name,account.name,account.Phone from contact where Phone=null];
for(contact c:lst)
{
c.account.phone='9177818131';
update c.account;
}
}
}
i will cal above method in anonymous block
-
- ajay ambati
- May 11, 2016
- Like
- 0
- Continue reading or reply
regarding relationships
iam having to master detiled relationship and lookup relation for the objects. i have deleted both records so, the delete rcords go to recycle bin. now my question is i have get back deleted records from recycle bin using undelete so, is possible to get both m-d-r and lookup object records?
which relation objects we can get pls hlp me?
which relation objects we can get pls hlp me?
-
- ajay ambati
- April 26, 2016
- Like
- 0
- Continue reading or reply
exceptions
how to avoid more dml and soql queries operations in loop? give me exact answer for this?
-
- ajay ambati
- April 20, 2016
- Like
- 0
- Continue reading or reply
-
- ajay ambati
- April 19, 2016
- Like
- 0
- Continue reading or reply
problm with after trigger
iam account and contact in account object iam having phonenumber=9999999999 and i need to update all contact mobilephone feild which are accosiated particular account i done with follwing code no error bt trigger not firing pls hlp....
trigger accountupdatetrigger on account (after update) {
if(trigger.isafter)
{
if(trigger.isupdate)
{
list<contact> lst = new list<contact>();
list <Account> a = [Select id,Name,phone, (Select id, Contact.FirstName,contact.LastName,contact.MobilePhone from Account.Contacts) From Account where phone ='99999999999'];
for(Account acc1:a)
{
for(schema.Contact cn:acc1.Contacts)
{
// lst.add(cn);
// }
// if(cn.MobilePhone!=null && cn.MobilePhone==null)
// {
cn.MobilePhone ='99999999999';
update cn;
}
}
}
}
}
trigger accountupdatetrigger on account (after update) {
if(trigger.isafter)
{
if(trigger.isupdate)
{
list<contact> lst = new list<contact>();
list <Account> a = [Select id,Name,phone, (Select id, Contact.FirstName,contact.LastName,contact.MobilePhone from Account.Contacts) From Account where phone ='99999999999'];
for(Account acc1:a)
{
for(schema.Contact cn:acc1.Contacts)
{
// lst.add(cn);
// }
// if(cn.MobilePhone!=null && cn.MobilePhone==null)
// {
cn.MobilePhone ='99999999999';
update cn;
}
}
}
}
}
-
- ajay ambati
- April 18, 2016
- Like
- 0
- Continue reading or reply
lightning issue on enabling
iam finding below error while iam enabiling the lightning in my developer account
- ajay ambati
- March 15, 2017
- Like
- 0
- Continue reading or reply
Issue on visualforce page
Iam developed one vfpage using custom controller.In this my requiremnt is retrieve all parent records(account related) in one pageblock table and all childrecords(contact related ) in one pgblocktable.so i done with this and its working iam retriving rcords of both but my another requiremnt is iam placed another button for save the records its not working iam getting error and also iam used inlineedit in this but not working below is my code
vfpage:
<apex:page controller="soql1" showHeader="false" >
<apex:form >
<apex:pageBlock title="listofparentrecordsacc" >
<apex:pageBlockButtons location="top" >
<apex:commandButton value="listofaccountsparent" action="{!myparentrecords}" />
<apex:commandButton value="listofcontactchid" action="{!mychildrecords}" />
<apex:commandButton value="save" action="{!save}" />
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!lst}" var="a" rendered="{!show}" >
<apex:column value="{!a.name}"/>
<apex:column value="{!a.industry}"/>
<apex:column headerValue="contacts">
<apex:repeat value="{!a.contacts}" var="b">
{!b.firstname}<br/>
</apex:repeat>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!cnt}" var="c" rendered="{!show1}">
<apex:column value="{!c.firstname}"/>
<apex:column value="{!c.lastname}"/>
<apex:column value="{!c.account.name}"/>
</apex:pageBlockTable>
<apex:inlineEditSupport />
<apex:pageblockTable value="{!lst1}" var="s">
<apex:column value="{!s.name}"/>
<apex:column value="{!s.industry}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
controller:
public class soql1
{
public string na {get;set;}
public string ind {get;set;}
public list<account> lst2 {get;set;}
public boolean show {get;set;}
public boolean show1 {get;set;}
public list<account> lst {get;set;}
public list<account> lst1 {get;set;}
public list<schema.contact> cnt{get;set;}
public void myparentrecords()
{
show=true;
show1=false;
lst=[select id,name,industry,(select id,firstname from contacts)from account];
}
public void mychildrecords()
{
show=false;
show1=true;
cnt=[select id,firstname,lastname,account.name from contact];
}
public PageReference save(){
account a=new account();
a.Name=na;
a.industry=ind;
// lst2 = [select id,name,industry from account ];
//if(a.name =='')
//{
//a.name=na;
lst1.add(a);
//}
insert lst1;
return null;
}
}
vfpage:
<apex:page controller="soql1" showHeader="false" >
<apex:form >
<apex:pageBlock title="listofparentrecordsacc" >
<apex:pageBlockButtons location="top" >
<apex:commandButton value="listofaccountsparent" action="{!myparentrecords}" />
<apex:commandButton value="listofcontactchid" action="{!mychildrecords}" />
<apex:commandButton value="save" action="{!save}" />
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!lst}" var="a" rendered="{!show}" >
<apex:column value="{!a.name}"/>
<apex:column value="{!a.industry}"/>
<apex:column headerValue="contacts">
<apex:repeat value="{!a.contacts}" var="b">
{!b.firstname}<br/>
</apex:repeat>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!cnt}" var="c" rendered="{!show1}">
<apex:column value="{!c.firstname}"/>
<apex:column value="{!c.lastname}"/>
<apex:column value="{!c.account.name}"/>
</apex:pageBlockTable>
<apex:inlineEditSupport />
<apex:pageblockTable value="{!lst1}" var="s">
<apex:column value="{!s.name}"/>
<apex:column value="{!s.industry}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
controller:
public class soql1
{
public string na {get;set;}
public string ind {get;set;}
public list<account> lst2 {get;set;}
public boolean show {get;set;}
public boolean show1 {get;set;}
public list<account> lst {get;set;}
public list<account> lst1 {get;set;}
public list<schema.contact> cnt{get;set;}
public void myparentrecords()
{
show=true;
show1=false;
lst=[select id,name,industry,(select id,firstname from contacts)from account];
}
public void mychildrecords()
{
show=false;
show1=true;
cnt=[select id,firstname,lastname,account.name from contact];
}
public PageReference save(){
account a=new account();
a.Name=na;
a.industry=ind;
// lst2 = [select id,name,industry from account ];
//if(a.name =='')
//{
//a.name=na;
lst1.add(a);
//}
insert lst1;
return null;
}
}
- ajay ambati
- March 13, 2017
- Like
- 0
- Continue reading or reply
soql not retriving record from parent object
1,hi,iam having two objects oppurtunity(parent) and another is custom object name is TopXDesignation__c(child) having MDR RELATIONSHIP and i want to retrieve records from parent i,e opportunity so, i wriiten soql query below
lstopp=[select id,Name,CloseDate,StageName,(select id,name,Document_Attached__c from TopXDesignation__r) from Opportunity];
but iam getting below error:
Didn't understand relationship 'aTopXDesignation__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
2,and also iam tried follwing type query not geeting
lstopp=[select id,Name,CloseDate,StageName,(select id,TopXDesignation__c.name,TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r) from Opportunity];
ERROR IS :
TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r)
^
ERROR at Row:1:Column:116
Didn't understand relationship 'TopXDesignation__c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
PLEASE ANSWER IT
lstopp=[select id,Name,CloseDate,StageName,(select id,name,Document_Attached__c from TopXDesignation__r) from Opportunity];
but iam getting below error:
Didn't understand relationship 'aTopXDesignation__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
2,and also iam tried follwing type query not geeting
lstopp=[select id,Name,CloseDate,StageName,(select id,TopXDesignation__c.name,TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r) from Opportunity];
ERROR IS :
TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r)
^
ERROR at Row:1:Column:116
Didn't understand relationship 'TopXDesignation__c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
PLEASE ANSWER IT
- ajay ambati
- September 30, 2016
- Like
- 0
- Continue reading or reply
trigger not firing on chekbox feild i
i am entering new values in account if phone is anything in account that must be same related contact phone and create related contact for that account.so its firing. but, after this i want to check the checkbox field in account thats not firing pls hlp me
trigger creatingcasebasedonaccounttrigger on Account (after insert)
{
list<schema.contact> lst = new list<schema.contact>();
list<account> gh = new list<account>();
list<Id> listIds = new List<Id>();
//schema.accc=new schema.contact();
if(trigger.isafter)
{
if(trigger.isinsert)
{
for(account acc:trigger.new)
{
System.debug('@@@@id is: ' + acc.Id);
System.debug('####name is : ' + acc.Name);
if(acc.phone !=null)
{
schema.contact cs = new schema.contact();
//cs.Account=acc.Name;
cs.lastname=acc.name;
//cs.closed Date='';
cs.accountid =acc.id;
cs.phone=acc.phone;
cs.contactrelaioncheckbox__c=true;
lst.add(cs);
}
}
}
//acc.CHECKEDACCOUNT__c=true;
insert lst;
list<account> lk =[select id,name,CHECKEDACCOUNT__c from account where id in:listIds];
for(account an:lk)
{
an.CHECKEDACCOUNT__c=true;
gh.add(an);
}
}
update gh;
}
trigger creatingcasebasedonaccounttrigger on Account (after insert)
{
list<schema.contact> lst = new list<schema.contact>();
list<account> gh = new list<account>();
list<Id> listIds = new List<Id>();
//schema.accc=new schema.contact();
if(trigger.isafter)
{
if(trigger.isinsert)
{
for(account acc:trigger.new)
{
System.debug('@@@@id is: ' + acc.Id);
System.debug('####name is : ' + acc.Name);
if(acc.phone !=null)
{
schema.contact cs = new schema.contact();
//cs.Account=acc.Name;
cs.lastname=acc.name;
//cs.closed Date='';
cs.accountid =acc.id;
cs.phone=acc.phone;
cs.contactrelaioncheckbox__c=true;
lst.add(cs);
}
}
}
//acc.CHECKEDACCOUNT__c=true;
insert lst;
list<account> lk =[select id,name,CHECKEDACCOUNT__c from account where id in:listIds];
for(account an:lk)
{
an.CHECKEDACCOUNT__c=true;
gh.add(an);
}
}
update gh;
}
- ajay ambati
- September 23, 2016
- Like
- 0
- Continue reading or reply
interview based question
1,how many soql queries allowed in trigger not in apex class?
2,can we process one record in batch apex class?
2,can we process one record in batch apex class?
- ajay ambati
- June 29, 2016
- Like
- 0
- Continue reading or reply
error while retriveing 100000 records in vfpage
Retrieving more than 100.000 records using select statement in visual force how can it possible?pls help me with exact soql query? but soql support only 50000 rows please hlp me.
- ajay ambati
- June 26, 2016
- Like
- 0
- Continue reading or reply
updating multiple records from child to parent in anonymous window hlp me plssss
iam executing this code in anonymous block iam getting error like my requirment is only in anonumos window
Line: 35, Column: 1
System.ListException: Duplicate id in list: 00128000003LLRkAAO
OK
pls hlp me
:*the following below is my code:*
list<account> lst1 = new list<account>();
list<schema.contact> lst = [select id,name,account.name,account.Fax from contact where account.Fax != null];
for(schema.contact c:lst)
{
system.debug('DISPLAY'+c.account.name);
system.debug('@@@@@@'+c.account.Fax);
//Account ac = [select id,name,fax from account where id=:c.account.id];
c.account.Fax='040-567-234';
lst1.add(c.account);
}
update lst1;
Line: 35, Column: 1
System.ListException: Duplicate id in list: 00128000003LLRkAAO
OK
pls hlp me
:*the following below is my code:*
list<account> lst1 = new list<account>();
list<schema.contact> lst = [select id,name,account.name,account.Fax from contact where account.Fax != null];
for(schema.contact c:lst)
{
system.debug('DISPLAY'+c.account.name);
system.debug('@@@@@@'+c.account.Fax);
//Account ac = [select id,name,fax from account where id=:c.account.id];
c.account.Fax='040-567-234';
lst1.add(c.account);
}
update lst1;
- ajay ambati
- June 02, 2016
- Like
- 0
- Continue reading or reply
batch apex error
iam new to the batch apex.here my question is batch apex job in exeute method iam passing list of accounts i,e 50,000 record ascynchronously and only 30,000 records inserted and remaining failed so,how to recognize the filed records where you found and how to reprocess that failed records?
- ajay ambati
- May 12, 2016
- Like
- 0
- Continue reading or reply
error in @future method
iam having list of account records and i want to pass in @FUTURE method is it possible or not? if not possible how can you pass the records with neat explanation i want step-wise procedure pls hlp me
- ajay ambati
- May 12, 2016
- Like
- 0
- Continue reading or reply
error in writing class
iam getting this Error: Compile Error: Variable does not exist: account at line 10 column 3
public class my
{
public void my1()
{
list<schema.contact> lst = [Select id,name,account.name,account.Phone from contact where Phone=null];
for(contact c:lst)
{
c.account.phone='9177818131';
update c.account;
}
}
}
i will cal above method in anonymous block
public class my
{
public void my1()
{
list<schema.contact> lst = [Select id,name,account.name,account.Phone from contact where Phone=null];
for(contact c:lst)
{
c.account.phone='9177818131';
update c.account;
}
}
}
i will cal above method in anonymous block
- ajay ambati
- May 11, 2016
- Like
- 0
- Continue reading or reply
problm with after trigger
iam account and contact in account object iam having phonenumber=9999999999 and i need to update all contact mobilephone feild which are accosiated particular account i done with follwing code no error bt trigger not firing pls hlp....
trigger accountupdatetrigger on account (after update) {
if(trigger.isafter)
{
if(trigger.isupdate)
{
list<contact> lst = new list<contact>();
list <Account> a = [Select id,Name,phone, (Select id, Contact.FirstName,contact.LastName,contact.MobilePhone from Account.Contacts) From Account where phone ='99999999999'];
for(Account acc1:a)
{
for(schema.Contact cn:acc1.Contacts)
{
// lst.add(cn);
// }
// if(cn.MobilePhone!=null && cn.MobilePhone==null)
// {
cn.MobilePhone ='99999999999';
update cn;
}
}
}
}
}
trigger accountupdatetrigger on account (after update) {
if(trigger.isafter)
{
if(trigger.isupdate)
{
list<contact> lst = new list<contact>();
list <Account> a = [Select id,Name,phone, (Select id, Contact.FirstName,contact.LastName,contact.MobilePhone from Account.Contacts) From Account where phone ='99999999999'];
for(Account acc1:a)
{
for(schema.Contact cn:acc1.Contacts)
{
// lst.add(cn);
// }
// if(cn.MobilePhone!=null && cn.MobilePhone==null)
// {
cn.MobilePhone ='99999999999';
update cn;
}
}
}
}
}
- ajay ambati
- April 18, 2016
- Like
- 0
- Continue reading or reply