• Rajesh Sriramulu
  • SMARTIE
  • 738 Points
  • Member since 2012
  • Salesforce Lightning Developer

  • Chatter
    Feed
  • 26
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 48
    Questions
  • 354
    Replies

Hi All,

I can able to do the code coverage for normal SOQL using Mock(startStubbing)  framework but for Dynamic SOQL it's not able to cover.

Much appreciated if any one replied. 

Thanks,
Rajesh

Hi All,

can we send email from Apex class with From address as no-reply @saleforce.com without setting Organization-Wide Addresses?

If we set Organization-Wide Addresses as no-reply @saleforce.com mail means Salesforce will sends a verification link to that email id, so that cannot be verified from us.
Can anyone advice on this.

Thanks,
Rajesh
Hi All,

I have array of string : one,two,three,four,"five1,five2", six ,seven,"eight1,eight2","nine",,eleven

I need output as :
one
two
three
four
five1,five2
six
seven
eight1,eight2
nine

eleven

Thanks in advance
We have a custom object Price Reuqest and have complex approval processes defined for it. We want to capture the Actual Approver for each step of the approval process. I checked forums about using ProcessInstanceHistory and ProcessInstanceWorkItem but i do not understand where to start from. Any help or code or steps on how to accomplish this will be helpful.
HI,

How to refresh or reload the embedded vf page not whole detail page.

Thanks in advance.
HI,

How to refresh or reload the embedded vf page not whole detail page.

Thanks in advance.

 
this is the trigger code:
trigger updateSeatTaken on Reservation__c (before insert, before update, after insert, after update) {
    List<Id> seatIdsForUpdate = new List<Id>();
    for (Reservation__c r : trigger.new) {
        seatIdsForUpdate.add(r.Seat__c);
    }
    List<Seat__c> seatsForUpdate = [SELECT taken__c FROM Seat__c WHERE Id IN: seatIdsForUpdate];

    for (Seat__c seat: seatsForUpdate) {
        seat.Taken__c = true;
    }
    update seatsForUpdate;
}


it works perfectly when the lookup field Seat__c has no filter.
but i need to have filter criterias for this lookup field.
these are the filter criterias:
Seat:Schedule__c     equals       Field        Reservation:Schedule__c  AND
Taken__c                     equals      Value       False

anyone knows what is the problem here?
Hi,

I have two text field A & B and one checkbox. I want when i click the check box address from A will get copy to B before saving.
Could you please suggest what should i do. Weather a trigger, Workflow or formula field.

Regards

Hi,

I need to write test class for inner class coverage. 

Class:

public class PerformanceReport
{
public String strFromDate {get; set;}
public String strToDate {get; set;}
public List<PerformanceReportClass> LstPerformanceReportClass {get;set;}
public Class PerformanceReportClass
{
public String strMRName{get;set;}
public String strMonth1{get;set;}
public String strMonth2{get;set;}
public String strMonth3{get;set;}
public String strMonth4{get;set;}
public String strMonth5{get;set;}
public String strMonth6{get;set;}
public String strMonth7{get;set;}
public String strMonth8{get;set;}
public String strMonth9{get;set;}
public String strMonth10{get;set;}
public String strMonth11{get;set;}
public String strMonth12{get;set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass1{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass2{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass3{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass4{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass5{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass6{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass7{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass8{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass9{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass10{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass11{get; set;}
public List<ReqmtDetailsClass> lstReqmtDetailsClass12{get; set;}
}
public class ReqmtDetailsClass
{
public string ReqmtName {get; set;}
public string ReqmtStatus {get; set;}
public string ReqmtPostdDate {get; set;}
public string ResumeReqstd {get; set;}
public string ResumeSubmtd {get; set;}
public string ResumeFirstPosted {get; set;}
public string ElapsedTimeFirstResumePosted {get; set;}
public string ReqmtClosedDate {get; set;}
public string ReqmtClosedHrs {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass2 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass3 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass4 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass5 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass6 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass7 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass8 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass9 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass10 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass11 {get; set;}
public List<CandtDetailsClass> lstCandtdetailClass12 {get; set;}
}

public class CandtDetailsClass
{
public string CandtName{get; set;}
public string CandtEmail{get; set;}
}
public PageReference GetReportDetails()
{
List<User> lstAllUser = new List<User>([SELECT id, name, LastModifiedDate, isActive from user where userroleid in (select id from userrole where name='Management Representative')]);
List<User> lstUser = new List<User>();
List<RequirementAssignment__c> lstReqmtAssign = new List<RequirementAssignment__c>();
List<RequirementAssignment__c> FilterReqmtAssign ;
List<RequirementAssignment__c> FilterReqmtAssignMonthly ;
List<Requirement__c> lstReqmts = new List<Requirement__c>();
if(strFromDate != null && strToDate != null)
{
DateTime startDT = DateTime.parse(strFromDate);
system.debug('Date:' + startDT);
DateTime endDT = DateTime.parse(strToDate);
system.debug('Date:' + endDT);
Date NewStartDate;
Integer startMonth = startDT.monthgmt();
Integer endMonth = endDT.monthgmt();
Integer startYear = startDT.yeargmt();
Integer endYear = endDT.yeargmt();
for(User allUser : lstAllUser)
{
if(allUser.IsActive == true)
{
lstUser.add(allUser);
}
else
{
if(allUser.LastModifiedDate > startDT)
{
lstUser.add(allUser);
}
}
}
lstReqmtAssign = [select Status__c, Requirement__c, Lead_Recruiter__c, Recruiter__c, createddate, createdbyid from RequirementAssignment__c where createddate >: startDT and createddate <: endDT ];

LstPerformanceReportClass = new List<PerformanceReportClass>();
for(User MRUSer : lstUser)
{
FilterReqmtAssign = new List<RequirementAssignment__c>();
for(RequirementAssignment__c ReqmAssign : lstReqmtAssign)
{
if(MRUSer.id == ReqmAssign.createdbyid)
{
FilterReqmtAssign.Add(ReqmAssign);
}
}
PerformanceReportClass objPerformanceReportClass = new PerformanceReportClass();
objPerformanceReportClass.strMonth1 = objPerformanceReportClass.strMonth2 = objPerformanceReportClass.strMonth3 = objPerformanceReportClass.strMonth4 = objPerformanceReportClass.strMonth5 = objPerformanceReportClass.strMonth6 = objPerformanceReportClass.strMonth7 = objPerformanceReportClass.strMonth8 = objPerformanceReportClass.strMonth9 = objPerformanceReportClass.strMonth10 = objPerformanceReportClass.strMonth11 = objPerformanceReportClass.strMonth12 = string.valueOf(0);
Integer count = 0;
NewStartDate = startDT.date();
Integer incrMonth = NewStartDate.month();
objPerformanceReportClass.strMRName = MRUSer.name;
if(FilterReqmtAssign != null)
{
for(integer i=startMonth; i<=endMonth; i++)
{
FilterReqmtAssignMonthly = new List<RequirementAssignment__c>();
for(RequirementAssignment__c ReqmAssignUser : FilterReqmtAssign)
{
DateTime ReqmtAssignDt = ReqmAssignUser.createddate;
Date ReqmAssignDate = Date.NewInstance(ReqmtAssignDt.yeargmt(), ReqmtAssignDt.monthgmt(), ReqmtAssignDt.daygmt());
System.Debug('Reqmt Assign Date:' +ReqmAssignDate);
System.Debug('Original Date:' + NewStartDate.month());
if((ReqmAssignDate.month() == incrMonth) && (ReqmAssignDate.year() == NewStartDate.year()))
{
FilterReqmtAssignMonthly.Add(ReqmAssignUser);
}
}
incrMonth++;
System.Debug('List Size:' +FilterReqmtAssignMonthly.size());
if(i==1)
{
objPerformanceReportClass.strMonth1 = string.valueOf(FilterReqmtAssignMonthly.size());
System.Debug('objReqmtAssignClass.strDate1:' +objPerformanceReportClass.strMonth1);
objPerformanceReportClass.lstReqmtDetailsClass1 = new List<ReqmtDetailsClass>();
Set<ID> setReqId = new Set<ID>();
for(RequirementAssignment__c Reqmt : FilterReqmtAssignMonthly)
{
System.Debug('Filter List Monthly'+FilterReqmtAssignMonthly);
System.Debug('Monthly Reqmt' +Reqmt);
setReqId.add(Reqmt.Requirement__c);
}
System.Debug('Id Set:' +setReqId);
if(setReqId.size()>0)
{
for(ID ReqID : setReqId)
{
System.Debug('Reqmt Id:' + ReqID);
List<Requirement__c> lstReqmtsResume= [Select id, Name, Status__c, createddate, No_Of_Resumes__c, Resumes_Submitted__c, Assign_Candidate_date__c, First_Response__c, Req_Closed_Date__c, Req_Closed_hrs__c from Requirement__c where id =:ReqID];
System.Debug('list Reqmts Resume:' +lstReqmtsResume);
List<Candidate_Mapping__c> lstCandtMapping = [select Candidate__r.Candidate_Full_Name__c , Candidate__r.Email__c from Candidate_Mapping__c where Requirement__c =:ReqID];
System.Debug('Candidates List:' +lstCandtMapping);
if(lstReqmtsResume.size()>0)
{
for(Requirement__c req:lstReqmtsResume)
{
ReqmtDetailsClass objReqmtDetailsClass1 = new ReqmtDetailsClass();
objReqmtDetailsClass1.lstCandtdetailClass = new List<CandtDetailsClass>();
System.Debug('Reqmt Resume:' +req);
objReqmtDetailsClass1.ReqmtName = string.valueOf(req.Name);
objReqmtDetailsClass1.ReqmtStatus = string.valueOf(req.Status__c);
objReqmtDetailsClass1.ReqmtPostdDate = string.valueOf(req.createddate);
objReqmtDetailsClass1.ResumeReqstd = string.valueOf(req.No_Of_Resumes__c);
objReqmtDetailsClass1.ResumeSubmtd = string.valueOf(req.Resumes_Submitted__c);
objReqmtDetailsClass1.ResumeFirstPosted = string.valueOf(req.Assign_Candidate_date__c);
objReqmtDetailsClass1.ElapsedTimeFirstResumePosted = string.valueOf(req.First_Response__c);
objReqmtDetailsClass1.ReqmtClosedDate = string.valueOf(req.Req_Closed_Date__c);
objReqmtDetailsClass1.ReqmtClosedHrs = string.valueOf(req.Req_Closed_hrs__c);
System.Debug('objReqmtDetailsClass1:'+objReqmtDetailsClass1);
objPerformanceReportClass.lstReqmtDetailsClass1.add(objReqmtDetailsClass1);
for(Candidate_Mapping__c candt :lstCandtMapping)
{
CandtDetailsClass objCandtDetailsClass1 = new CandtDetailsClass();
objCandtDetailsClass1.CandtName = string.valueOf(candt.Candidate__r.Candidate_Full_Name__c);
objCandtDetailsClass1.CandtEmail = string.valueOf(candt.Candidate__r.Email__c);
objReqmtDetailsClass1.lstCandtdetailClass.add(objCandtDetailsClass1);
}
}
}
}
}

}
else if(i==2)
{
objPerformanceReportClass.strMonth2 = string.valueOf(FilterReqmtAssignMonthly.size());
System.Debug('objReqmtAssignClass.strDate2:' +objPerformanceReportClass.strMonth2);
objPerformanceReportClass.lstReqmtDetailsClass2 = new List<ReqmtDetailsClass>();
Set<ID> setReqId = new Set<ID>();
for(RequirementAssignment__c Reqmt : FilterReqmtAssignMonthly)
{
System.Debug('Filter List Monthly'+FilterReqmtAssignMonthly);
System.Debug('Monthly Reqmt' +Reqmt);
setReqId.add(Reqmt.Requirement__c);
}
System.Debug('Id Set:' +setReqId);
if(setReqId.size()>0)
{
for(ID ReqID : setReqId)
{
System.Debug('Reqmt Id:' + ReqID);
List<Requirement__c> lstReqmtsResume= [Select id, Name, Status__c, createddate, No_Of_Resumes__c, Resumes_Submitted__c, Assign_Candidate_date__c, First_Response__c, Req_Closed_Date__c, Req_Closed_hrs__c from Requirement__c where id =:ReqID];
System.Debug('list Reqmts Resume:' +lstReqmtsResume);
if(lstReqmtsResume.size()>0)
{
for(Requirement__c req:lstReqmtsResume)
{
ReqmtDetailsClass objReqmtDetailsClass2 = new ReqmtDetailsClass();
System.Debug('Reqmt Resume:' +req);
objReqmtDetailsClass2.ReqmtName = string.valueOf(req.Name);
objReqmtDetailsClass2.ReqmtStatus = string.valueOf(req.Status__c);
objReqmtDetailsClass2.ReqmtPostdDate = string.valueOf(req.createddate);
objReqmtDetailsClass2.ResumeReqstd = string.valueOf(req.No_Of_Resumes__c);
objReqmtDetailsClass2.ResumeSubmtd = string.valueOf(req.Resumes_Submitted__c);
objReqmtDetailsClass2.ResumeFirstPosted = string.valueOf(req.Assign_Candidate_date__c);
objReqmtDetailsClass2.ElapsedTimeFirstResumePosted = string.valueOf(req.First_Response__c);
objReqmtDetailsClass2.ReqmtClosedDate = string.valueOf(req.Req_Closed_Date__c);
objReqmtDetailsClass2.ReqmtClosedHrs = string.valueOf(req.Req_Closed_hrs__c);
System.Debug('objReqmtDetailsClass2:'+objReqmtDetailsClass2);
objPerformanceReportClass.lstReqmtDetailsClass2.add(objReqmtDetailsClass2);
}}}}}}
LstPerformanceReportClass.add(objPerformanceReportClass);
}}}
return null;
}}

Test Class:

@isTest
private class testclassperformancereport
{
static testmethod void myTestclass()
{
Candidate_Mapping__c cm = new Candidate_Mapping__c();

Candidate__c cc1=new Candidate__c();
cc1.Name='test';
cc1.Last_name__c='testonek';
cc1.Current_city__c='chennai';
cc1.Current_state__c='Maine';
cc1.Gender__c='Male';
cc1.Employer_Name__c='ttt';
cc1.Email__c='test@gmail.com';
cc1.interview_contact_phone__c='Mobile Phone';
cc1.Contract_type__c='Corp to Corp';
cc1.visa_type__c='H1 B';
cc1.cost__c =100;
cc1.mobile_phone_no__c='9890043500';
cc1.employer_contact_email__c='test@gmail.com';
cc1.Employer_Contact_Name_Name__c='tt';
cc1.Employer_Mobile_No__c='9988009876';
cc1.Employer_Name__c = 'jos';
cc1.Employer_Work_Phone_No__c = '(425) 264-6771';
cc1.Followup_Date__c =date.today();

System.test.startTest();
insert cc1;

cm.Candidate__c=cc1.id;
system.debug('candid:'+cc1.id);

Requirement__c rc1=new Requirement__c();

rc1.Name='SampathReq';
rc1.Job_Title__c='.net';
rc1.Duration__c='6';
rc1.No_Of_Resumes__c=2;
rc1.Min_Cost__c=100;
rc1.Max_Cost__c=200;
rc1.Rate__c=200;
rc1.Rate_Basis__c='Hourly';
rc1.Status__c='open';
rc1.Position_Type__c='Contract';
rc1.State__c='CA';
rc1.City__c='CA';
rc1.Est_Start_Date__c=date.today();
insert rc1;
User lruser = [select u.id from user u where (u.Profile.Name ='Lead Recruiter' or u.Profile.Name ='LR Chatter Only User') and u.ManagerId!=null and u.IsActive= True limit 1] ;
User ruser = [select u.id from user u where (u.Profile.Name ='Recruiter' or u.Profile.Name ='R Chatter Only User') and u.ManagerId!=null and u.IsActive= True limit 1] ;

RequirementAssignment__c reqas = new RequirementAssignment__c();

reqas.Requirement__c = rc1.id;
reqas.AssignStatus__c= 'true';
reqas.Won__c= 'no';
reqas.Lead_Recruiter__c = lruser.id;
//reqas.Recruiter__c = ruser.id;
insert reqas;

cm.Requirement__c=rc1.id;
system.debug('candid:'+cc1.id);

cm.Employer_s_Authorization__c = 'test';
cm.status1__c = 'Applied';
cm.LR_Comments__c = 'test by lr';
cm.MR_Comments__c = 'test by MR';
cm.Requirement_Owner_Email__c = 'testOwner@preludesys.com';
cm.Manager_Email_ID__c = 'testOwner1@preludesys.com';
cm.LR_Status__c = 'Approved';
cm.MR_Status__c = 'Approved';
cm.LR_Status_Date__c = string.valueOf(date.today());
cm.Submitted_to_Client__c = 'Yes';
cm.Interview_Scheduled__c = 'Yes';
cm.Interview_Accepted__c = 'Yes';
cm.Client_Interviewed__c = 'Yes';
cm.Client_Offered__c = 'Yes';
cm.Comments__c = '';
cm.MR_Status1__c = 'Approved' ;

User user = [Select Id from User limit 1] ;

EmailTemplate et = [Select Id, Subject, HtmlValue, Body from EmailTemplate where Name = 'Candidate Approval Email with link EZRE'];
List<ContentVersion> contentList = new List<ContentVersion>();

ContentWorkspace library = [SELECT id FROM ContentWorkspace LIMIT 1];
System.Debug('library.id:'+ library.id);

ContentVersion contentVersionObj = new ContentVersion();

contentVersionObj.title = 'Google';//contentVersionObj.Enablement_Area__c = 'Acct Mgmt';
contentVersionObj.FirstPublishLocationId = library.id;
contentVersionObj.Candidate_Id__c = cc1.Id;
contentVersionObj.VersionData = Blob.valueOf('Ayangar') ;
contentVersionObj.PathOnclient = 'http://www.google.com';
contentVersionObj.Title ='Management Approach';

insert contentVersionObj;
System.Debug('ContentVersionObj:'+ contentVersionObj);

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
efa.setFileName('Sasikumar.Word');
efa.setBody(Blob.ValueOf(et.Body));
System.Debug('efa:' +efa);
String[] toAddresses = new string[]{'dummy@yahoo.com'};
mail.setTargetObjectId(user.Id);
mail.setToAddresses(toAddresses);

mail.setTemplateId(et.Id);

mail.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});
mail.saveAsActivity = false;
// Sends the email
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});

insert cm;

datetime nowdate = datetime.now();

string strfromdate = nowdate.format('MM/dd/yyyy hh:mm a');

datetime newdate= nowdate.addMonths(2);

string strtodate = newdate.format('MM/dd/yyyy hh:mm a');

List<RequirementAssignment__c> lstReqmtAssign = new List<RequirementAssignment__c>();

PerformanceReport pr = new PerformanceReport();

list<PerformanceReportClass> c = new List<PerformanceReportClass>();

datetime startdate = datetime.parse(strfromdate);
system.debug('startdate :' + startdate);

datetime enddate = datetime.parse(strtodate);
system.debug('enddate :' + enddate);

lstReqmtAssign = [select Status__c, Requirement__c, Lead_Recruiter__c, Recruiter__c, createddate, createdbyid from RequirementAssignment__c where createddate >= 2013-09-01T00:00:00.000+0000 and createddate <=2013-09-25T00:00:00.000+0000 ];

System.debug('lstReqmtAssign: ' + lstReqmtAssign);


List<Requirement__c> lstReqmtsResume= [Select id, Name, Status__c, createddate, No_Of_Resumes__c, Resumes_Submitted__c, Assign_Candidate_date__c, First_Response__c, Req_Closed_Date__c, Req_Closed_hrs__c from Requirement__c where id =:rc1.id];
System.Debug('list Reqmts Resume:' +lstReqmtsResume);

List<Candidate_Mapping__c> lstCandtMapping = [select Candidate__r.Candidate_Full_Name__c , Candidate__r.Email__c from Candidate_Mapping__c where Requirement__c =:rc1.id];
System.Debug('Candidates List:' +lstCandtMapping);

pr.GetReportDetails();

}
}

 

What ever i modify in the test class, the code coverage is 3% only, Kindly help meto fix this.

 

Regards,

Abinaya.

Hi,

I have a requirement where in I have table with 6 fields. The first 5 fields are picklist and sixth one is Number field.

Now ,the user can select any values from each of the picklists and based on the selection of values from the picklist , I will need to perform some numeric calculation and display the numerica value in the 6th field on the fly.

 

Currently my sixth field is a formula field , but the issue is , that formula field calculates and displays only after clicking on the save; Whereas my requirement is that the user can see the change in the value of the 6th field on the fly as and when the user selects or changes the value in any of the first 5 fields.

 

Please help!

 

 

I'm new on salesforce.

I'm trying to create dependent fields according to picklist value selection.

In the following code I want:

1: when I select "None" in picklist no field should display.

2: if I select 1st option in the picklist; only field1 should get display.

3: if I select 2nd option in the picklist; only field2 should get display.

3: and if I select 3rd option in the picklist; all the fields1,2&3 should get display.

 

Please Help me out of this task.. Thanks!

 

/////////////////////Visualforce///////////////////////

<apex:page controller="FieldSelection">
      <apex:pageBlock title="fields">
          <apex:form >
                <b>State:</b> <t/><t/>
                <apex:selectList id="sta" value="{!SelectedState}" size="1">
                    <apex:selectOptions value="{!StateList}" />
                </apex:selectList>
                <br/><br/>
                <b>Field1:</b><t/><t/>
                <apex:inputText required="true" id="city1" value="{!city1}" />
                <br/><br/>
                <b>Field2:</b><t/><t/>
                <apex:inputText required="true" id="city2" value="{!city2}" />
                <br/><br/>
                <b>Field3:</b><t/><t/>
                <apex:inputText required="true" id="city3" value="{!city3}" />
                
          </apex:form>
      </apex:pageBlock>
</apex:page>

 

 

 

/////////////////////////Controller/////////////////////////////////

public with sharing class FieldSelection {

    public String city3 { get; set; }

    public String city2 { get; set; }

    public String city1 { get; set; }

    public String SelectedState { get; set; }
    
    public list<SelectOption> StateList{
    get{
            list<SelectOption> st= new list<SelectOption>();
            st.add(new SelectOption('','- None -'));
            List<UV_Account__c> lFINAL = New List<UV_Account__c>();
            list<UV_Account__c> cc=[select State__c from UV_Account__c];
            Set<String> sNames = New Set<String>();
            for (UV_Account__c c : cc){
            if (sNames.Contains(c.State__c) == FALSE){
               sNames.add(c.State__c);
               lFINAL.add(c);
        }
        }
            
            for( UV_Account__c fc : lFINAL)
            {
                st.add(new SelectOption(fc.id,fc.State__c));
            }
            return st;
       }
     set; }

}

Hi,

 

I want to display list like below.

 

 

------------------------------------------------------------------

 - | Parent 1

------------------------------------------------------------------

    | X | child 1

------------------------------------------------------------------

    | X | child 2

------------------------------------------------------------------

    | X | child 3

------------------------------------------------------------------

 + | Parent 2

------------------------------------------------------------------

 + | Parent 3

------------------------------------------------------------------

 

There is "+" before parent records, if we click on "+", it should be expand its childs.

If it is possible that child records can be display using pageblock table then it is very good.

 

Anyone have idea how to develop this in vf page?

Hi EveryOne,

 

When I try to export data from workbench when Iquery means it showing all records but when I try to download means it's showing error like this.

 

InvalidJob: Unable to find object: attachments.

 

query is SELECT id,(SELECT id FROM attachments) FROM Account where owner.isactive = false and owner.email like '%@gmail.com'.

 

Could any one please help on this.

And if any one knows how to export records displayed in developer console.

 

 

Thanks in Advance.

 

Thanks,

 

Rajesh.

We have a custom button that executes JavaScript on our case record:

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}
this.disabled=true;
try{
var accId='{!Account.Id}';
var objectId = '{!Case.Id}';

var result = sforce.apex.execute("ForceJiraComm", "createIssue",
{case_id : objectId});
alert(result);
location = location;
}
catch(err) {
txt="There was an error on this page.\n\n";
txt+="Error description: " + err + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
}
this.removeAttribute('disabled');

We want it to also write the full name of the user that clicked the button to the custom field JIRA_Escalated_By__c on the case object.  How do we do this?

Basically, how can update our APEX to store who clicks a custom button?”

trigger users on User (before insert, before update) {

    if(Test.isrunningtest()) {
        system.debug('Allowing user create/edit.');
    } else {
        List<User> oUser = [SELECT Id, Security_user__c, ProfileId, UserName FROM User WHERE Id = :System.UserInfo.getUserId() LIMIT 1];
        If(oUser[0].UserName.endsWith('.dev10')){
          
            system.debug('IS DEV USER: Allowing user create/edit.');
        } else {
            Boolean isSecurityUser = oUser[0].Security_user__c;
            if(isSecurityUser) {
              
             
            } else {
                if(Trigger.isUpdate) {
                    List<Profile> list_pAdmin = [SELECT Id FROM Profile WHERE Name IN ('System Administrator','SL: System Administrator','SL: Sys Admin ','SL: Read Only Admin','SL: Read Only Admin Non ') LIMIT 5];
                    Set<String> set_pAdmin = new Set<String>();
                    for(Profile pAdmin : list_pAdmin) {
                        set_pAdmin.add(pAdmin.Id);
                    }
                    for(User oUserRec : Trigger.New) {
                        if((oUserRec.Id == System.UserInfo.getUserId()) && (!set_pAdmin.contains(oUser[0].ProfileId))) {
                            system.debug('IS THE USERS OWN RECORD AND THEY ARE NOT A SYS ADMIN: Allowing user create/edit.');
                        } else {
                            system.debug('IS NOT A TEST, DEV ENVIRONMENT, A SECURITY USER OR THE USERS OWN RECORD: Forbidding user create/edit.');
                            oUserRec .addError('You do not have permission to create or edit user records!');
                        }
                    }
                } else {
                    for(User oUserRec : Trigger.New) {
                        system.debug('IS NOT A TEST, DEV ENVIRONMENT, A SECURITY USER OR THE USERS OWN RECORD: Forbidding user create/edit.');
                        oUserRec .addError('You do not have permission to create or edit user records!');
                    }
                }
            }
        }
    }

}

Hi..

     can we create an simple calculater application in the apex page.if it s possible in saelsforce..

        help me..

Hello All,

 

I have an inline visulaforce page in my Case Pagelayout. I want to refresh it on a particular click event. How can we make it possible. Please help me regarding this issue.

 

 

Thank you!

 

Regards,

Lakshman