• ramya1
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 14
    Replies

Hi,

 

I am fing the following issue while displaying list of records after dynamic search..

I used the following code : 

 


public ApexPages.StandardSetController Agen{get;set;}

 

query = 'select id,name,Programme_Name__c from opportunity where ';

   
    ProgrammeName = userinputData.Programme_Name__c;
    if(ProgrammeName != null && ProgrammeName !=''){
        query = query +'  Programme_Name__c = \''+ProgrammeName+'\'';

    }
 Agen = new ApexPages.StandardSetController(Database.getQueryLocator(query ));

Agen.setPageSize(200); 

 

 

Am getting the error when the count of the records exceeds 10000.If i specify a limit of 10000,then i don't get the error,but i have a list of 35000 records on my object.

 

Please help me to solve this issue.

 

Thanks in advance .

 

  • November 20, 2013
  • Like
  • 0

Hi

 

I called the Approvalprocess dynamically as soon as the record is created by using the code in the following method.

 

 public pagereference updateTimeSheet(){
         
         Timesheet__c getCurrentTimesheet = [select id,Comments__c,Project_Task__r.Assigned_To__c,Project_Task__r.CreatedById ,Timesheet__c.Project__r.ownerid,Approve__c,Approval_Status__c from timesheet__c where id=:this.id];
         
         system.debug(getCurrentTimesheet);
         User[] Approver = [select id from user where id=:getCurrentTimesheet.Project_Task__r.Assigned_To__c];
         system.debug('!!!!!!!!!!!!!!!!!!!!!!'+Approver );
         id[] uid = new id[]{};
         uid.add(Approver[0].id);
         
         Approval.ProcessSubmitRequest app = new Approval.ProcessSubmitRequest();
         app.setObjectId(getCurrentTimesheet.id);
         app.setNextApproverIds(uid);
         Approval.ProcessResult result = Approval.process(app);      
        
         update getCurrentTimesheet;
         
         return null;
    }

 

I Called the method on the Page..So that when the records are created,Approval process will be called Automatically..

 

Page :

 

<apex:page standardController="Timesheet__c" extensions="ApproveBillController" action="{!updateTimeSheet}">
 
</apex:page>

 

Issue is,When a Timesheet is created using Save button,then the approval process is getting called..

 

But,When we use Save&New  button while creating multiple records..Then the Approval process is not getting called.

 

  • August 12, 2013
  • Like
  • 0

Hi,

 

How can we make a case visible to the created by user?

In the sharing Settings we have it as private..How can we make it visible to only  the createdby user?

 

Thanks in Advance.

 

Ramya.

  • April 26, 2013
  • Like
  • 0

Hi..

 

I am Working on Site usage reports..I tried to run reports for the sites..i am getting the reports..

But now I want to get the list of recently searched records in that particular site..these records are getting displayed from an object...

How can I accomplish this task?

 

Thanks in Advance.

 

Ramya.

 

  • March 11, 2013
  • Like
  • 0

Hi..

 

Am trying to build a dynamic query for search Scenario...i used the following code..

 

public void searchAppointment()
{

string query = 'select id,name,branch__c,doctor__c,Appt_Reason__c,Appt_Status__c,Appt_Date__c from appointment__c WHERE ';

 

appointmentBranch = userinputData.branch__c;
if(appointmentBranch != null){
query = query+' branch__c includes (\''+appointmentBranch +'\')';
}

appointmentReason = userinputData.Appt_Reason__c;
if(appointmentReason != null){
query = query+'AND Appt_Reason__c includes (\''+appointmentReason +'\')';
}

 

runQuery();

}

 

public void runQuery() {
system.debug('..QUERY5..'+QUERY);
try{
apptmnt = Database.query(query); 
}catch(exception e){}
system.debug('Appointmenttttttt'+apptmnt);
}

 

 

Am getting values in the Query within the searchAppointment method...

am getting issue in the runQuery method...values are not getting passed into Query here ..

Getting error as : 

System.NullPointerException: Argument 1 cannot be null

 

 

Thanks in Advance..

  • March 01, 2013
  • Like
  • 0

 

I have an Issue regarding Displaying the name field in Pageblocktable column ....

 

The field is a text field with 80 characters...

If i have a record with name 60 characters,the name is getting Displayed in a single line...So that we need to Scroll the Table...

I want to Break the long names into different lines within the Column...so that the names gets fixed within the length..

 

<apex:column headerValue="Philips 12NC">
<a href="/{!a.Philips_12NC__r.id}" target="_Blank" >
<apex:smileysurprised:utputfield value="{!a.Philips_12NC__r.name}"/></a>
</apex:column>

 

I am trying to use Wrap functionality...But not getting proper output...

Can you Please help me to Solve this...

 

Thanks in Advance..

  • February 19, 2013
  • Like
  • 0

Hi...

 

I have an Issue in a Test case....

 

While inserting the Opportunity....I used the ClosedDate Field...But am getting Error as 

 

System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [CloseDate]: [CloseDate]

 

Test Case that i Have Used is : 

 

@isTest
private class NewDisbursementMemo_TC
{
static testMethod void test()
{

Branch__c b = new Branch__c();
b.name = 'qwe';
insert b;

Account a = new account();
a.name='asd';
insert a;

Opportunity o=new Opportunity ();
o.Name='qwer';
o.CloseDate=date.ValueOf('2011-09-21');
o.StageName='Prospecting';
o.Branch__c=b.id;
o.AccountId = a.id;
insert o;  // Getting Error at this line

Disbursement__c d= new Disbursement__c();
d.Loan__c=o.id;
insert d;

ApexPages.currentPage().getParameters().put('id', d.id);
ApexPages.StandardController con = new ApexPages.StandardController(d);
NewDisbursementMemo ext = new NewDisbursementMemo(con);

}
}

 

 

Thanks in Advance 

 

 

  • February 05, 2013
  • Like
  • 0

Hi..

 

Am working on search scenario with multiselect picklists...

 

For example if the field has values like  A,B,C,D.....  and the records 1 and 2 contains  1) Open,test    2) New,test within them

 

During Search if I Give Open,test or New,test  the Recordds are getting searched correctly.....

 

But the requirement is, i need to display the record  1  if i give only Open for the field instead of Open,test ...i need to work with contains functionality...

 

While trying to use CONTAINS(Disability__c,'Open','test','New')  am getting an error as unexpected token: ','

 


The Query that i used is :

 

orgselected = [select id,name,Organisation_Name__c,Disability__c,County__c,Age_of_Clients_Served__c,Type_of_Service__c from Organisation__c
where (CONTAINS(Disability__c,'Open','test','New'))

or
(name=:userinput.name and Disability__c =:userinput.Disability__c and County__c=:userinput.County__c and Type_of_Service__c =:userinput.Type_of_Service__c and Age_of_Clients_Served__c=:userinput.Age_of_Clients_Served__c)
or

(name=:userinput.name or Disability__c =:userinput.Disability__c or County__c=:userinput.County__c or Type_of_Service__c =:userinput.Type_of_Service__c or Age_of_Clients_Served__c=:userinput.Age_of_Clients_Served__c)];

 

 

  • January 17, 2013
  • Like
  • 0

Hi,

 

I have a visual force page which display multiple records with check box's.

I  need to allow the user to select only one check box at a time.If they are trying to select a another check box should display a alert saying that u r allowed to check only one record at a time.

 

I am trying to map all the fields of a record when the checkbox is selected....I want to generate an error message when more than one record was selected... 

 

Thanks in advance

  • January 02, 2013
  • Like
  • 0

Hi,

 

Am trying to get all the tasks and events (even the previous years records) for a particular object...

 

For that scenario am trying to use queryall() function...

while using that i used  

 

String soqltask = "SELECT id, whatid FROM task";
QueryResult qr = connection.queryAll(soqlQuery);

 


But while using the above am getting an error as  Invalid type: QueryResult.

 

Can anyone help me how to use the query to get all the tasks for an object and how to use Queryresult..

 

Thanks in advance,

 

 

  • December 13, 2012
  • Like
  • 0

Hi,

 

Am trying to override Event/Task pages..when am trying to override records of previous year record(i,e 2011)..

am getting an error as ..

 

Data Not Available
The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at oursupport page.

 

Am not able to find why the error was generating for only some records..

 

Thanx in advance.

  • December 11, 2012
  • Like
  • 0

Hi,

 

Am using wrapper class in adding new row and deleting row functionality...

 

when we click button on addrow link,new row gets added...when we click delete button on a particular row,the row gets deleted...

 

am getting an error while trying to use rerender in the delete button, it gets rendered to pageblock table where am using rich text field...

 

getting an error as : Rerender is not currently supported with rich text editing enabled.

 

If i try to remove the rerender,then the row was not getting deleted.......can anyone help me to solve this issue..

 

Thanx in advance!!

.

 

 

  • November 19, 2012
  • Like
  • 0

Hi,

 

Am trying to display list of leave applications which counts number of days from FromDate to ToDate...I have a Formula field named  NoOfDays  which counts the number of leave days excluding saturdays and sundays...

 

there were a list of holidays..now i want to exclude the  holiday  from NoOfDays  if it falls between from and to dates....

i used

 

d = userinput.From_Includes_this_day__c;
d1 = userinput.To_Includes_this_day_also__c;

 

leave = [select id,name,Manager_Email_Id__c,From_Includes_this_day__c,To_Includes_this_day_also__c,Reason__c,CreatedDate,Approved__c,
Numberofdays__c,CreatedById from Leave_Applications__c where CreatedById=:usr.id order by From_Includes_this_day__c];

 

 holidaysweek = [select id,name,ActivityDate from Holiday where ActivityDate>=:d AND ActivityDate<=:d1 ];

 holidayscount = holidaysweek.size();

 

ON PAGE I USED

 

<apex:column headerValue="Total No of days">
{!floor(a.Numberofdays__c -holidayscount )}
</apex:column>

 

when am trying to use the above....counts are not getting displayed....

am not getting the proper output....

  • September 24, 2012
  • Like
  • 0

Hi

 

Am trying to do pagination for opportunityLineItems...i used the Query 

 

 public ApexPages.StandardSetController ssc {get; set;}

 

ssc = new ApexPages.StandardsetController(Database.getQueryLocator([select id,unitprice,PricebookEntry.Product2Id,product__c,PricebookEntry.Product2.Name,Opportunity.Product__r.Id,Product__r.Name,
Opportunity.Product__r.name,Purchase__c, PricebookEntryId,ServiceDate,Quantity,Action__c,Vendor__r.Name ,Opportunity.Name,Opportunity.StageName
from OpportunityLineItem where opportunityid!=: OPP.id and product__c=:userinput.product__c order by unitprice limit 100]));

 

its getting saved...during execution am getting an error as : 

 

List controllers are not supported for OpportunityLineItem 

 

Can any one suggest an alternate way of using custom pagination..

 

Thanks in Advance..

 

 

  • August 27, 2012
  • Like
  • 0

hi,

              Am trying to make the class dynamic..am getting error at parentQuery...getting unexpected token: 'Project__c'  in which 

Project__c is parent name in the query...

 

 

string parentQuery = 'SELECT Id FROM ' + parentName + ' where id=\'' + parentID + '\'';
 SObject ParentObject = Database.query(parentQuery)[0];

 

thanks in advance...

  • August 03, 2012
  • Like
  • 0

Hi,

 

I did a flow which deletes a record from an object..is it possible to fire the flow as soon as the record gets updated as we work in the case of triggers and workflows?

Do we have an option to delete the record automatically inspite of running the flow and passing values of record dynamically within the flow..

 

Thanks in advance..

HI

 Am new to salesforce..I  wrote a trigger .it is working fine but now i want to bulkify my trigger...please help me to bulkification.

I am sending the trigger . 

please help me for bulkification.....thanks in advance

 

 

trigger WOW_Block_Time on Appointment__c (before Insert,before update)
{
for(Appointment__c APP : Trigger.new)
{
Time_blocks__c[] TBS = [select id,name,branch__c,date__c,staff__c from Time_blocks__c where Branch__c =:APP.Branch__c AND Date__c =:APP.Appt_Date__c AND RecordTypeId='012O0000000CldF'];

if(TBS.size()>0)
{
App.adderror('Blocked Branch!!');
}

Time_blocks__c[] TBS1 = [select id, name , Branch__c , date__c , staff__c from Time_blocks__c where Branch__c =:APP.Branch__c AND Date__c =:APP.Appt_Date__c AND staff__c =:App.Doctor__c AND RecordTypeId='012O0000000CldK'];

if(TBS1.size()>0)
{
App.adderror('Blocked staff');
}

Time_blocks__c[] TBS2 = [select id,Appt_24_Frm_Hour__c,Appt_24_Frm_Min__c,Apt_24_To_Hour__c,Apt_24_To_Min__c from Time_blocks__c where
Branch__c =:APP.Branch__c AND Date__c =:APP.Appt_Date__c AND staff__c =:App.Doctor__c AND RecordTypeId='012O0000000ClgY'
AND Appt_24_Frm_Hour__c !=:null AND Apt_24_To_Hour__c !=:null ];
if(TBS2.size()>0)
{
for(Time_blocks__c tbs3:tbs2)
{
integer fromhr=integer.valueof(tbs3.Appt_24_Frm_Hour__c);
integer frommin=integer.valueof(tbs3.Appt_24_Frm_Min__c);
integer tohr=integer.valueof(tbs3.Apt_24_To_Hour__c );
integer tomin=integer.valueof(tbs3.Apt_24_To_Min__c);

integer hr=integer.valueof(app.Appt_Hour__c);
integer min=integer.valueof(app.Appt_Minute__c);

if(app.Appt_AM_PM__c=='AM')
{
if((hr>=fromhr &&hr<=tohr&&min>=frommin&&min<=tomin)||(hr>fromhr &&hr<tohr)|| (hr>=fromhr &&hr<tohr&&min>=frommin&&min>=tomin)||(hr>fromhr &&hr<=tohr&&min<=frommin&&min<=tomin))
{
app.adderror('time blocked');
}
}
else if(app.Appt_AM_PM__c=='PM')
{
if(hr==12)
{
hr=12;
}
else
{
hr=hr+12;
}
if((hr>=fromhr &&hr<=tohr&&min>=frommin&&min<=tomin)||(hr>fromhr &&hr<tohr)|| (hr>=fromhr &&hr<tohr&&min>=frommin&&min>=tomin)||(hr>fromhr &&hr<=tohr&&min<=frommin&&min<=tomin))
{
app.adderror('time blocked1');
}

}


}

}

Time_blocks__c[] TBS4 = [select id,date__c from Time_blocks__c where Date__c =:APP.Appt_Date__c AND RecordTypeId='012O0000000ClhH'];

if(TBS4.size()>0)
{
App.adderror('Blocked date');
}


}

}

Hi

 

I called the Approvalprocess dynamically as soon as the record is created by using the code in the following method.

 

 public pagereference updateTimeSheet(){
         
         Timesheet__c getCurrentTimesheet = [select id,Comments__c,Project_Task__r.Assigned_To__c,Project_Task__r.CreatedById ,Timesheet__c.Project__r.ownerid,Approve__c,Approval_Status__c from timesheet__c where id=:this.id];
         
         system.debug(getCurrentTimesheet);
         User[] Approver = [select id from user where id=:getCurrentTimesheet.Project_Task__r.Assigned_To__c];
         system.debug('!!!!!!!!!!!!!!!!!!!!!!'+Approver );
         id[] uid = new id[]{};
         uid.add(Approver[0].id);
         
         Approval.ProcessSubmitRequest app = new Approval.ProcessSubmitRequest();
         app.setObjectId(getCurrentTimesheet.id);
         app.setNextApproverIds(uid);
         Approval.ProcessResult result = Approval.process(app);      
        
         update getCurrentTimesheet;
         
         return null;
    }

 

I Called the method on the Page..So that when the records are created,Approval process will be called Automatically..

 

Page :

 

<apex:page standardController="Timesheet__c" extensions="ApproveBillController" action="{!updateTimeSheet}">
 
</apex:page>

 

Issue is,When a Timesheet is created using Save button,then the approval process is getting called..

 

But,When we use Save&New  button while creating multiple records..Then the Approval process is not getting called.

 

  • August 12, 2013
  • Like
  • 0

Hi,

 

How can we make a case visible to the created by user?

In the sharing Settings we have it as private..How can we make it visible to only  the createdby user?

 

Thanks in Advance.

 

Ramya.

  • April 26, 2013
  • Like
  • 0

Hi..

 

Am trying to build a dynamic query for search Scenario...i used the following code..

 

public void searchAppointment()
{

string query = 'select id,name,branch__c,doctor__c,Appt_Reason__c,Appt_Status__c,Appt_Date__c from appointment__c WHERE ';

 

appointmentBranch = userinputData.branch__c;
if(appointmentBranch != null){
query = query+' branch__c includes (\''+appointmentBranch +'\')';
}

appointmentReason = userinputData.Appt_Reason__c;
if(appointmentReason != null){
query = query+'AND Appt_Reason__c includes (\''+appointmentReason +'\')';
}

 

runQuery();

}

 

public void runQuery() {
system.debug('..QUERY5..'+QUERY);
try{
apptmnt = Database.query(query); 
}catch(exception e){}
system.debug('Appointmenttttttt'+apptmnt);
}

 

 

Am getting values in the Query within the searchAppointment method...

am getting issue in the runQuery method...values are not getting passed into Query here ..

Getting error as : 

System.NullPointerException: Argument 1 cannot be null

 

 

Thanks in Advance..

  • March 01, 2013
  • Like
  • 0

 

I have an Issue regarding Displaying the name field in Pageblocktable column ....

 

The field is a text field with 80 characters...

If i have a record with name 60 characters,the name is getting Displayed in a single line...So that we need to Scroll the Table...

I want to Break the long names into different lines within the Column...so that the names gets fixed within the length..

 

<apex:column headerValue="Philips 12NC">
<a href="/{!a.Philips_12NC__r.id}" target="_Blank" >
<apex:smileysurprised:utputfield value="{!a.Philips_12NC__r.name}"/></a>
</apex:column>

 

I am trying to use Wrap functionality...But not getting proper output...

Can you Please help me to Solve this...

 

Thanks in Advance..

  • February 19, 2013
  • Like
  • 0

Hi...

 

I have an Issue in a Test case....

 

While inserting the Opportunity....I used the ClosedDate Field...But am getting Error as 

 

System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [CloseDate]: [CloseDate]

 

Test Case that i Have Used is : 

 

@isTest
private class NewDisbursementMemo_TC
{
static testMethod void test()
{

Branch__c b = new Branch__c();
b.name = 'qwe';
insert b;

Account a = new account();
a.name='asd';
insert a;

Opportunity o=new Opportunity ();
o.Name='qwer';
o.CloseDate=date.ValueOf('2011-09-21');
o.StageName='Prospecting';
o.Branch__c=b.id;
o.AccountId = a.id;
insert o;  // Getting Error at this line

Disbursement__c d= new Disbursement__c();
d.Loan__c=o.id;
insert d;

ApexPages.currentPage().getParameters().put('id', d.id);
ApexPages.StandardController con = new ApexPages.StandardController(d);
NewDisbursementMemo ext = new NewDisbursementMemo(con);

}
}

 

 

Thanks in Advance 

 

 

  • February 05, 2013
  • Like
  • 0

Hi..

 

Am working on search scenario with multiselect picklists...

 

For example if the field has values like  A,B,C,D.....  and the records 1 and 2 contains  1) Open,test    2) New,test within them

 

During Search if I Give Open,test or New,test  the Recordds are getting searched correctly.....

 

But the requirement is, i need to display the record  1  if i give only Open for the field instead of Open,test ...i need to work with contains functionality...

 

While trying to use CONTAINS(Disability__c,'Open','test','New')  am getting an error as unexpected token: ','

 


The Query that i used is :

 

orgselected = [select id,name,Organisation_Name__c,Disability__c,County__c,Age_of_Clients_Served__c,Type_of_Service__c from Organisation__c
where (CONTAINS(Disability__c,'Open','test','New'))

or
(name=:userinput.name and Disability__c =:userinput.Disability__c and County__c=:userinput.County__c and Type_of_Service__c =:userinput.Type_of_Service__c and Age_of_Clients_Served__c=:userinput.Age_of_Clients_Served__c)
or

(name=:userinput.name or Disability__c =:userinput.Disability__c or County__c=:userinput.County__c or Type_of_Service__c =:userinput.Type_of_Service__c or Age_of_Clients_Served__c=:userinput.Age_of_Clients_Served__c)];

 

 

  • January 17, 2013
  • Like
  • 0

Hi,

 

I have a visual force page which display multiple records with check box's.

I  need to allow the user to select only one check box at a time.If they are trying to select a another check box should display a alert saying that u r allowed to check only one record at a time.

 

I am trying to map all the fields of a record when the checkbox is selected....I want to generate an error message when more than one record was selected... 

 

Thanks in advance

  • January 02, 2013
  • Like
  • 0

Hi,

 

Am trying to override Event/Task pages..when am trying to override records of previous year record(i,e 2011)..

am getting an error as ..

 

Data Not Available
The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at oursupport page.

 

Am not able to find why the error was generating for only some records..

 

Thanx in advance.

  • December 11, 2012
  • Like
  • 0

I have worked for user friendly webpages using CSS printing styles.In that pages,I want  to breaks the pages(one pages to multiple pages).I have tried But its not works.Can Anyone post some code for pagebreaks in user friendly webpages(Links also didn't works)?

 

Hi,

 

Am using wrapper class in adding new row and deleting row functionality...

 

when we click button on addrow link,new row gets added...when we click delete button on a particular row,the row gets deleted...

 

am getting an error while trying to use rerender in the delete button, it gets rendered to pageblock table where am using rich text field...

 

getting an error as : Rerender is not currently supported with rich text editing enabled.

 

If i try to remove the rerender,then the row was not getting deleted.......can anyone help me to solve this issue..

 

Thanx in advance!!

.

 

 

  • November 19, 2012
  • Like
  • 0

hi,

              Am trying to make the class dynamic..am getting error at parentQuery...getting unexpected token: 'Project__c'  in which 

Project__c is parent name in the query...

 

 

string parentQuery = 'SELECT Id FROM ' + parentName + ' where id=\'' + parentID + '\'';
 SObject ParentObject = Database.query(parentQuery)[0];

 

thanks in advance...

  • August 03, 2012
  • Like
  • 0