• Thiyagarajan Selvaraj
  • NEWBIE
  • 50 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 10
    Replies

i have a method in my code 

public List<Meeting_ActionItem__c> getActionItem1(){
return [SELECT Action_Item_Description__c,project__c,Status__c,Date_Assigned__c,Due_Date__c,assigned_to__c FROM Meeting_ActionItem__c where Meeting_Master__r.id=
:ApexPages.currentPage().getParameters().get('id')];


}

 

its a controller class i am using this list in <apex:dataTable> in Date_Assigned__c i am getting date in format  Thu Feb 28 00:00:00 GMT 2013 but i want it in this format YYYY-MM-DD

 

i was searching go through this link http://boards.developerforce.com/t5/General-Development/Date-format-in-SOQL-query/td-p/191486

last solution in this link is showing is copying all fields to a different object in different date format .i doubt if there are suppose 100,000 then it will take considerable time for copying fields .please suggest any other efficient solution 

hello,

 

I have tables for sections,questions and response with master detail relationship between sction and question, question and response table. I want to display all of them with response under question and all questions under section.

 

Apex code 

public class QuestionnaireFieldsReport
{

public List<Question_Template__c> questionsLists { get; set; }
public List<Section_Template__c > sectionsLists{ get; set; }
public List<Questionnaire_Response__c> QuestionResponse{get;set;}
public List<QuestionDisplay> listQuestWithOptions;

 

//create a new inner class 
public class QuestionDisplay
{

public Question_Template__c newquestFormat{get;set;}
public List<Question_Template__c > qlistss {get;set;}
public List<Questionnaire_Response__c> rlistss{get;set;}
public Section_Template__c secObj{get;set;}



public QuestionDisplay(Section_Template__c sobj,List<Question_Template__c > ql,List<Questionnaire_Response__c> rl)
{
secObj= new Section_Template__c ();
qlistss =new List<Question_Template__c>();
rlistss= new List<Questionnaire_Response__c>();
this.secObj=sobj;
this.qlistss =ql;
this.rlistss=rl;
}
}//end inner class


public List<QuestionDisplay> getquestionsList()
{
Integer i=0;
listQuestWithOptions= new QuestionDisplay[]{};
accountId=System.currentPageReference().getParameters().get('accId');//to get the school or account id
//System.debug('!!!!!!!!!!!!!!!!~~~~~~~~~~~~~acct id from diff page :'+accountid);
sectionsLists = [Select Id, Name,status__c,Section_label__c,Order_No__c from Section_Template__c];
QuestionResponse=[Select id,Response__c,Question_Template__r.id,Question_Template__r.Question_Label__c,Account_to_Response__c,Questionnaire_Taker_user__c from Questionnaire_Response__c where Account_to_Response__c= :accountId] ;


for(integer w=0;w<sectionsLists.size();w++)
{
List<Question_Template__c > qlists= new List<Question_Template__c>();
List<Questionnaire_Response__c> rlists= new List<Questionnaire_Response__c>();
questionsLists = [SELECT Id,Section_Question__r.id,Question_Label__c,Question_Order_No__c FROM Question_Template__c where Section_Question__r.id=:sectionsLists[w].id order by Question_Order_No__c];

for(integer w1=0;w1<questionsLists.size();w1++)
{
Questionnaire_Response__c resp=new Questionnaire_Response__c();
if((QuestionResponse==null)||(QuestionResponse.size()==0))
{

rlists.add(resp);
qlists.add(questionsLists[w1]);
}
else
{
integer checkflag=0;
for(integer k=0;k<QuestionResponse.size();k++)
{
if(QuestionResponse[k].Question_Template__r.id==questionsLists[w1].id)
{
checkflag=1;resp=QuestionResponse[k];break;
}
}

rlists.add(resp);
qlists.add(questionsLists[w1]);
}

}

//r is reponse list and qlists is question list
listQuestWithOptions.add(new QuestionDisplay(sectionsLists[w],qlists,rlists) );

}


}

 

Visualforce code

I want the response and questions list to iterate alternatively

 

<apex:repeat value="{!questionsList}" var="section">
<apex:variable var="rlists" value="{!section.rlistss}"/>
<apex:pageBlockSection id="subsection" columns="1" title="{!section.secObj.Section_label__c}">
<apex:repeat value="{!section.qlistss}" var="qlist">
<apex:outputField value="{!qlist.Question_Label__c}" />
<apex:outputField value="{!rlists.Response__c}" /> <!-- this fails as i do not know how to iterate both together-->
<br> </br>

</apex:repeat>

 

 

Thanks

  • January 29, 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 a method in my code 

public List<Meeting_ActionItem__c> getActionItem1(){
return [SELECT Action_Item_Description__c,project__c,Status__c,Date_Assigned__c,Due_Date__c,assigned_to__c FROM Meeting_ActionItem__c where Meeting_Master__r.id=
:ApexPages.currentPage().getParameters().get('id')];


}

 

its a controller class i am using this list in <apex:dataTable> in Date_Assigned__c i am getting date in format  Thu Feb 28 00:00:00 GMT 2013 but i want it in this format YYYY-MM-DD

 

i was searching go through this link http://boards.developerforce.com/t5/General-Development/Date-format-in-SOQL-query/td-p/191486

last solution in this link is showing is copying all fields to a different object in different date format .i doubt if there are suppose 100,000 then it will take considerable time for copying fields .please suggest any other efficient solution 

Anyone know if there's a way to set breakpoints and get Heap Dumps when running an Apex Test?

 

I've tried ti with no luck.  I open Dev Console, when the Repository, selected the module and put a couple break points in.  Then I tried kick off the test but in another window and also in the Dev Console.  I never got any Heap Dumps in the Heap Dump tab.

 

Anye clue?

I am getting a save error with entity not org-accesible for my trigger below. 

 

trigger InterviewerPickerTrigger on Interviewer__c (after insert, before delete, after delete) {
if (Trigger.isInsert){
List<Review__c> reviews = new List<Review__c>();
List<Job_Application__Share> jobAppShares = new List<Job_Application__Share>();
List<Candidate__Share> candidateShares = new List<Candidate__Share>();
List<ID> positionIds = new List<ID>();

// get a list of all the position ids
for(Interviewer__c i:Trigger.new){
System.debug('*****************the interviewer record: ' + i);
positionIds.add(i.Position__c);
}

// select all the job apps associated to those positions
List<Job_Application__c> jobApps = [select j.id,j.position__c,j.candidate__c,j.candidate__r.ownerid from Job_Application__c j where j.position__c IN :positionIds];

// loop thru all the jobApps we just retrieved
for(Job_Application__c jobApp:jobApps){
for(Interviewer__c i:Trigger.new){
if (i.Position__c == jobApp.Position__c){
// create the new review sobject
Review__c review = new Review__c();
review.Interviewer__c = i.Id;
review.Job_Application__c = jobApp.Id;
reviews.add(review);
// create the jobApp share sobject ONLY if the interviewer is not the owner of the job app
if (i.employee__c != jobApp.ownerid){
Job_Application__Share jobAppShare = new Job_Application__Share();
jobAppShare.ParentId = jobApp.Id;
jobAppShare.UserOrGroupId = i.Employee__c;
jobAppShare.AccessLevel = 'Edit';
jobAppShares.add(jobAppShare);
}
// now the candidate share sobject ONLY if the interviewer is not the owner of the candidate
if (i.employee__c != jobApp.candidate__r.ownerid){
// make sure there is a candidate on the Job App
if (jobApp.candidate__c != null){
Candidate__Share candidateShare = new Candidate__Share();
candidateShare.ParentId = jobApp.candidate__c;
candidateShare.UserOrGroupId = i.Employee__c;
candidateShare.AccessLevel = 'Read';
candidateShares.add(candidateShare);
}
}
}
}
}
// now create the incomplete reviews for the interviewers
insert reviews;

// now share the job apps and candidates with the interviewer
System.debug('***candidateShares=' + candidateShares);
insert candidateShares;
System.debug('***jobAppShares=' + jobAppShares);
insert jobAppShares;

} else if (Trigger.isDelete){
if (Trigger.isBefore){
// first remove the reviews associated to the interviewer **only if they are not already completed
Map<ID,Interviewer__c> iMap = Trigger.oldMap;
List<Review__c> reviews = [select id,job_application__c,interviewer__c from review__c where interviewer__c IN :iMap.keySet() and review_completed__c != true];
delete reviews;
} else if (Trigger.isAfter){
// now remove the sharing from the old interviewer on the Job App and Candidate

}
}
}

Hi all,on vf page,iam having 4 checkbox, as
[].a)salesforce
[].b)sap
[].c)oracle
[].d)siebel
[].e)ibm
[].f)cloud
when ever checkbox like a,f are checked , only a) and f) should go to my custom object as A,F ..so after i need to compare it with correct answer which is in other object as A,F,,HOW TO COMPARE IT?? Am not gud in wrapper class,can any one help me to move..

I am having several projects and each project conatins several task.

project task  need to be shown like in production,inventory respectively

If i click one project , that project task alone need to displayed  in corresponding production/inventory

 

others need not to be shown. in which way it can be accomplished.  how to work with condition based .

 

Ex

  If  a click link , id can be cached by jquery/javascript, then which way we can pass that in to apex page/controller 

 

 

Hi ,

 

I've built the following extension to override new buttong for my Return Object.

<apex:page standardController="Return_Claim__c" extensions="returnExtension">

<apex:pageblock title="Return Claim Edit">

<apex:pageBlockButtons >
 <apex:form >
    <apex:commandButton value="Save" action="{!save}"/>
    <apex:commandButton value="Cancel" action="{!cancel}"/>
 </apex:form>   
</apex:pageBlockButtons>




<apex:pageBlockSection title="Return Details" collapsible="false">

    <apex:pageBlockSectionItem >
        <label><b><font face="arial" color="gray">Return Type</font></b></label> 
        <apex:form > <apex:inputField required="true" value="{!Return_Claim__c.Return_Type__c}"/> </apex:form>
    </apex:pageBlockSectionItem>
     
    <apex:pageBlockSectionItem >
         <label><b><font face="arial" color="gray">Serial Number</font></b></label>
         <apex:form > <apex:inputField required="true" value="{!Return_Claim__c.Serial_Number__c}"/> </apex:form> 
    </apex:pageBlockSectionItem>
     
   </apex:pageBlockSection>
</apex:pageblock>
</apex:page>

 The extension is :

 

public class returnExtension {

    public ApexPages.StandardController con;
    public return_claim__c retn;
    public List<return_claim__c> result;


   
   public returnExtension(ApexPages.StandardController controller) {
        
       con = controller;   
       retn=(return_claim__c)controller.getRecord();
     
    }
    
    public PageReference save()
    {
        con.save();
  //      insert retn;
        return null;
    }


    
   
}

 Everything's working okay in the VF Page.

 

PROBLEM -- when I click on the save button; a record gets created but the values in the corrosponding fields do not get inserted.

 

PLEASE HELP ME OUT. I have tried almost all the dicussions board topics similar to this. nothing's helping.

haiii..................

 

 

 i created one visualforce page such that it consists of

 

                                           1,skillset_________                     <-------------by entering values in these fields

                                            2,keywords______________

                                            3,experience__________

                                        _______

                                       |   search  | <----------------By clicking on search  i need to get the records present on the standard object (applicant)... what i need to do .is there any sample code..

 

 

can any one help urgent

 

hello,

 

I have tables for sections,questions and response with master detail relationship between sction and question, question and response table. I want to display all of them with response under question and all questions under section.

 

Apex code 

public class QuestionnaireFieldsReport
{

public List<Question_Template__c> questionsLists { get; set; }
public List<Section_Template__c > sectionsLists{ get; set; }
public List<Questionnaire_Response__c> QuestionResponse{get;set;}
public List<QuestionDisplay> listQuestWithOptions;

 

//create a new inner class 
public class QuestionDisplay
{

public Question_Template__c newquestFormat{get;set;}
public List<Question_Template__c > qlistss {get;set;}
public List<Questionnaire_Response__c> rlistss{get;set;}
public Section_Template__c secObj{get;set;}



public QuestionDisplay(Section_Template__c sobj,List<Question_Template__c > ql,List<Questionnaire_Response__c> rl)
{
secObj= new Section_Template__c ();
qlistss =new List<Question_Template__c>();
rlistss= new List<Questionnaire_Response__c>();
this.secObj=sobj;
this.qlistss =ql;
this.rlistss=rl;
}
}//end inner class


public List<QuestionDisplay> getquestionsList()
{
Integer i=0;
listQuestWithOptions= new QuestionDisplay[]{};
accountId=System.currentPageReference().getParameters().get('accId');//to get the school or account id
//System.debug('!!!!!!!!!!!!!!!!~~~~~~~~~~~~~acct id from diff page :'+accountid);
sectionsLists = [Select Id, Name,status__c,Section_label__c,Order_No__c from Section_Template__c];
QuestionResponse=[Select id,Response__c,Question_Template__r.id,Question_Template__r.Question_Label__c,Account_to_Response__c,Questionnaire_Taker_user__c from Questionnaire_Response__c where Account_to_Response__c= :accountId] ;


for(integer w=0;w<sectionsLists.size();w++)
{
List<Question_Template__c > qlists= new List<Question_Template__c>();
List<Questionnaire_Response__c> rlists= new List<Questionnaire_Response__c>();
questionsLists = [SELECT Id,Section_Question__r.id,Question_Label__c,Question_Order_No__c FROM Question_Template__c where Section_Question__r.id=:sectionsLists[w].id order by Question_Order_No__c];

for(integer w1=0;w1<questionsLists.size();w1++)
{
Questionnaire_Response__c resp=new Questionnaire_Response__c();
if((QuestionResponse==null)||(QuestionResponse.size()==0))
{

rlists.add(resp);
qlists.add(questionsLists[w1]);
}
else
{
integer checkflag=0;
for(integer k=0;k<QuestionResponse.size();k++)
{
if(QuestionResponse[k].Question_Template__r.id==questionsLists[w1].id)
{
checkflag=1;resp=QuestionResponse[k];break;
}
}

rlists.add(resp);
qlists.add(questionsLists[w1]);
}

}

//r is reponse list and qlists is question list
listQuestWithOptions.add(new QuestionDisplay(sectionsLists[w],qlists,rlists) );

}


}

 

Visualforce code

I want the response and questions list to iterate alternatively

 

<apex:repeat value="{!questionsList}" var="section">
<apex:variable var="rlists" value="{!section.rlistss}"/>
<apex:pageBlockSection id="subsection" columns="1" title="{!section.secObj.Section_label__c}">
<apex:repeat value="{!section.qlistss}" var="qlist">
<apex:outputField value="{!qlist.Question_Label__c}" />
<apex:outputField value="{!rlists.Response__c}" /> <!-- this fails as i do not know how to iterate both together-->
<br> </br>

</apex:repeat>

 

 

Thanks

  • January 29, 2013
  • Like
  • 0