• suresh.csk
  • NEWBIE
  • 180 Points
  • Member since 2010

  • Chatter
    Feed
  • 6
    Best Answers
  • 19
    Likes Received
  • 0
    Likes Given
  • 39
    Questions
  • 75
    Replies

I know there are some other posts about this, but I cannot make much sense of them I am new to apex and salesforce, learned a considerable amount in the time I've been working with it, but right now Im up against a wall, and its BAD

 

I, for whatever reason, could not make opportunities in my sandbox, could not figure out why, but wanted to try this trigger. So like a fool I put it to production. No nobody can create or edit anything [a Work order - custom object we use to project details]  We NEED this to work. My company is at a halt, I NEED to remove or disable this trigger asap.

 

I tried to mark it as inactive in sandbox, and push it to production, but it says "Average test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required." I have NOO idea what this means and no time to figure anything out. Needless to say - I am freaking out. PLEASE someone help.

Hi,

 

 I am just trying to add an survey form in salesforce, can anybody tell me how do i do it, can i download it from app exchange , or do i need to write code for it

 

 

Thanks

Hello,

 

I want to call an external job , made with talend, from my trigger when a certain status changes.

 

How can we do tha?

 

Thanks!!

Hi All,

 

I have 3 vf pages .!st page is eventdetails page where i have all outputfields showing event details .In this page i have a button called proceed for registration .The controller code for this page is

 

public  class  Proceedbutton {
     
     private  final  ApexPages.StandardController  controller;
 
     public  Proceedbutton (ApexPages.StandardController  stdController) {
         this.controller =  stdController;
    }
    
    
    
   Static Id id1=ApexPages.currentPage().getParameters().get('id');
    
    
    
    public  PageReference  proceed()
    {
         Pagereference  EventRegister=  Page.EventRegister;
         EventRegister.setRedirect(True);
         return  EventRegister;
         
    }
    Public static Id getid()
    { return id1;}
    }

Here in this controller I am trying to get the event id in the id1 variable after that it goes to Eventregister page.

 

 

In Eventregister page,User enters his information and clicks register .Here I have controller which stores the data and goes to tranks vf page .

 

Here’s the code

 

public  class  Registerbutton {

     private  final  ApexPages.StandardController  controller;
 
     public  Registerbutton (ApexPages.StandardController  stdController) {
         this.controller =  stdController;
    }
    
     public  PageReference  Register()
    {
       Registrant__c   reg = (Registrant__c)controller.getRecord();
       
       
       reg.Event__c=Proceedbutton.getid();
       //reg.Event__c='a06S0000002VZMw';
       insert  reg;
       Pagereference  EventThankyou =  Page.EventThankyou  ;
       EventThankyou.setRedirect(True);
       return  EventThankyou;
    }
    }

 

 

In this controller , just before saving the registrant record, I am calling the getid() method on proceedbutton controller to get the eventid .I am trying to link all registrants to that event by doing so.Event__c is a lookup field on Registrant object pointing to Event object

 

But I am not getting the expected result  in the line reg.Event__c=Proceedbutton.getid();

 

Can anyone please help me what I am doing wrong here ?

Hi.

I use Mule to connect to salesforce to get the records.
The records are searched on bases of some field value for example I search for policy number.
So i give policy number in the html page,the page uses MULE to get records from Salesforce.
If match record exists the records are displayed in the html page.

But we dont get any error or timeout from salesforce
There is No Response from the salesforce.

Noted:
The search fields are indexed in the salesforce.

Anyone has expereinced this type,please help.

Thanks
suresh

 
Hi.

Created a Email Approval Process for the Emails sent from Case.
The Apporval Process is not fired even for simple conditons.
Email Message: Created Date = today
Initial Submitters = Record Creator

The Email is sent without apporval process.
 
Hi.

We need 3 Certifcates
1.SSL Certificate.
2.CA Intermediate Certiticate.
3.Root Certifcate.
If you dont got the root certitifcate from the provider,you can download it from the provider website/home page.

Uploading CA-Signed Certiifcate as follows.
1.Open a Notepad.
2.Paste each certificate as per below order into the note pad.
-----BEGIN CERTIFICATE----- 
(SSL certificate) 
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- 
(CA Intermediate certificate) 
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- 
(Root certificate) 
-----END CERTIFICATE------
3.Save the notepad as "sitesSSL.cer" or "xxx.cer"
4.Now goto Settting>Security Control>Certtificate and Key Managment
5.Select the certificate in which you want to upload.
6.Upload the newly created sitesSSL.cer
7.If no errors than your done and chek your site from the browser whether you have a lock sign in the browser or not.
cheer
suresh
 
I made very simple report which has date grouping in my report.
The report is generated properly in the ipad Salesfroce1 App.

In PC view the grouping fields work and they display.
When I view the same report in iPad using Salesforce1 it is not working.
User need to access Salesforce only on the company provided Mobile(iphone,Android,BlackBeery).
Currently Mobile Iron MDM is used.
How to deny access Salesforce when user login using the private mobile.
 
Hi.
I need to stop the batch or I dont want to excute the batch if my condition fails.
Simply I need to exit or break the batch.
In the below code when I tried to do nothing by returning NULL in start method i get error
System.UnexpectedException: Start did not return a valid iterable object..

global Database.QueryLocator start(Database.BatchableContext ctx){
String runBatch = false;
String sql = ' Select Id from Account where city__c ='NewYork' ;
if(runBatch == true)
return Database.getQueryLocator(sql);
}
return null;
}

I also checked the https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AffaIAC
but I dont want to return itetrable object in thr try catch like this..

try{
   return iterable object;//this is correct with your existing code
}catch(Exception x){
   System.debug(Error Message);
   return iterable object;
}
I need to break or do nothing.Is ther any other ways?
cheers
suresh
 
Hi.
Updated to Force,com IDE to summer 14
1.It takes long time to refresh from server
2.It takes long time to save to server
3.The Major issue not supporting UTF-8
Compilation error: Invalid string literal

 
Hi.

In the VF I used the date format as YYYY-MM-dd in the 
<apex:outputText value="{0,date,YYYY/MM/dd}">
Before the last week of the year it was OK. When the new year falls in the  last week of Decemeber comes the issue.
For example
2014:
S   M  T  W Th F Sat
28 29 30 31 1   2 3

In the above calendar 1st Jan of 2015 falls in the Thurusday.So when I viewd the records of 28,29,30 of December 2014 It showed as
2015-12-28
2015-12-29
2015-12-30
2015-12-31

After that I came to know that
@"YYYY" is week-based calendar year.
@"yyyy" is ordinary calendar year.
http://realmacsoftware.com/blog/working-with-date-and-time

cheers
suresh



 
Need to extend the standarad page date picker's Year using javascript.
Tried with VF page by injecting into the component console.
But due to cross-domain security issues,not able to do.
Any other ways...
 
Hi.

I have a inline VF Page in the standarad Page.
The user edits a field in the standarad Page using inline.
Now the standarad page show save and cancel button.

The user never saved the standarad Page,but he goes to some action by clicking the button  in the Inline VF Page.
When the user clicks button in the InlineVF Page,I need to alert that the standarad Page has not be saved.

Cant get any thing from url key like e?retURL.
I was trying to get the document.elementbyId,getElementsByTagName,document.getElementsByClassName to check whether the 
standarad save button display stlye block.


Standarad Save button:
<input class="btn" type="button" onclick="sfdcPage.save();" name="inlineEditSave" style="display: inline;" title="Save" value="Save ">

Inline VF Page button:

<input class="btn" type="submit" value="Save" name="j_id0:mtmrHeaderform:j_id8">




hi.

I pass custom object List to visualforce component which assigns to apex varaible as same type.
But I get error like

ApexPagesHandledException: Cannot convert the value of '{!customObjectList}' to the expected type

<apex:component controller="MyController"  >
<apex:attribute name="customDetials" description="supplementary detials" type="CustomObject__c[ ]" assignTo="{!customeObjectList}"/>

public class MyContorller{

public List<CustomObject__c> customeObjectList{get;set;}

}


Both attribute name and apex variable are of same type but not being assigned.
Does anyone came across like this

Best Regards
suresh
Hi.

When you popup window using the fucntion "openPopupFocusEscapePounds" take care that
there is no unwanted space in url or in title.

I had a space in the title like this

openPopupFocusEscapePounds('google.com','testpage ',...other parmeters...)

The space in the title made the popup to close,no error is displayed and pop up cant open.
After deleting the space in the title,it worked.

Best Regards
suresh

Hi.

Is it possible to add css directly to a component like this.

<apex:component >
       <style type="text/css">
                  td{
                    style="height:10"
                      }
      </style>
     <table>
           <tr>
           <td>Test</td>
           </tr>
    </table>
</apex:component>


Best Regards
suresh
AND (
Effective_End_Date__c >= Effective_Start_Date__c ,
(Effective_Start_Date__c - today()) == 1
)

The above rule is not firing.
Will the below code works in workflow 
Effective_Start_Date__c - today()) == 1 

Hi.

 

I have 3 fields.

StartDate

EndDate

Active(checkbox).

 

Is it possbile to obtain Active to checked and unchecked by looking at the date every time when the 

startdate/ enddate is modified.

 

I was able to uncheck after 1 day of enddate. 

But not able to do check and uncheck  when ever the start date and end date is changed.

 

regards

suresh

Hi.

I can export the csv file with line feed('\n').

How to export with CRLF ('\r\n').

 

any idea greatlt appreictaed

regards

suresh

Hi.

 

Created new EE account, this account  is for development and testing.

Now I need to copy the Produtction to the newly create EE account.

Which is the easy and best way.

 

cheers

suresh

 

Hi.

 

Is there any way not to share all the content files with other users.

I like know to sharing setting with respect to file ,not with respect to the libray folder.

 

cheers

suresh

Hi.

 

I sharing a record with many users using Apex sharing.

So how many user can share a record,is there any maximum limit for a record can be shared.

 

for example how many users can share a sinlge record called "Product1 record"

 

 

cheers

suresh

 

Hi.
 
Im sending mail throughtApex,the receiver mail has somethings like
 
from: tester@gmail.com via dcs9hayusmal.o-uuh3mag.o.bnc.sandbox.salesforce.com
 
I need to hide/disable the below when sending the mail from Apex.
" via dcs9hayusmal.o-uuh3mag.o.bnc.sandbox.salesforce.com "
 
cheers
suresh
Hi.

We need 3 Certifcates
1.SSL Certificate.
2.CA Intermediate Certiticate.
3.Root Certifcate.
If you dont got the root certitifcate from the provider,you can download it from the provider website/home page.

Uploading CA-Signed Certiifcate as follows.
1.Open a Notepad.
2.Paste each certificate as per below order into the note pad.
-----BEGIN CERTIFICATE----- 
(SSL certificate) 
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- 
(CA Intermediate certificate) 
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- 
(Root certificate) 
-----END CERTIFICATE------
3.Save the notepad as "sitesSSL.cer" or "xxx.cer"
4.Now goto Settting>Security Control>Certtificate and Key Managment
5.Select the certificate in which you want to upload.
6.Upload the newly created sitesSSL.cer
7.If no errors than your done and chek your site from the browser whether you have a lock sign in the browser or not.
cheer
suresh
 
Hi.

In the VF I used the date format as YYYY-MM-dd in the 
<apex:outputText value="{0,date,YYYY/MM/dd}">
Before the last week of the year it was OK. When the new year falls in the  last week of Decemeber comes the issue.
For example
2014:
S   M  T  W Th F Sat
28 29 30 31 1   2 3

In the above calendar 1st Jan of 2015 falls in the Thurusday.So when I viewd the records of 28,29,30 of December 2014 It showed as
2015-12-28
2015-12-29
2015-12-30
2015-12-31

After that I came to know that
@"YYYY" is week-based calendar year.
@"yyyy" is ordinary calendar year.
http://realmacsoftware.com/blog/working-with-date-and-time

cheers
suresh



 
Hi.

Created a Email Approval Process for the Emails sent from Case.
The Apporval Process is not fired even for simple conditons.
Email Message: Created Date = today
Initial Submitters = Record Creator

The Email is sent without apporval process.
 
Hi.

We need 3 Certifcates
1.SSL Certificate.
2.CA Intermediate Certiticate.
3.Root Certifcate.
If you dont got the root certitifcate from the provider,you can download it from the provider website/home page.

Uploading CA-Signed Certiifcate as follows.
1.Open a Notepad.
2.Paste each certificate as per below order into the note pad.
-----BEGIN CERTIFICATE----- 
(SSL certificate) 
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- 
(CA Intermediate certificate) 
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- 
(Root certificate) 
-----END CERTIFICATE------
3.Save the notepad as "sitesSSL.cer" or "xxx.cer"
4.Now goto Settting>Security Control>Certtificate and Key Managment
5.Select the certificate in which you want to upload.
6.Upload the newly created sitesSSL.cer
7.If no errors than your done and chek your site from the browser whether you have a lock sign in the browser or not.
cheer
suresh
 
User need to access Salesforce only on the company provided Mobile(iphone,Android,BlackBeery).
Currently Mobile Iron MDM is used.
How to deny access Salesforce when user login using the private mobile.
 
Hi.
I need to stop the batch or I dont want to excute the batch if my condition fails.
Simply I need to exit or break the batch.
In the below code when I tried to do nothing by returning NULL in start method i get error
System.UnexpectedException: Start did not return a valid iterable object..

global Database.QueryLocator start(Database.BatchableContext ctx){
String runBatch = false;
String sql = ' Select Id from Account where city__c ='NewYork' ;
if(runBatch == true)
return Database.getQueryLocator(sql);
}
return null;
}

I also checked the https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AffaIAC
but I dont want to return itetrable object in thr try catch like this..

try{
   return iterable object;//this is correct with your existing code
}catch(Exception x){
   System.debug(Error Message);
   return iterable object;
}
I need to break or do nothing.Is ther any other ways?
cheers
suresh
 
Need to extend the standarad page date picker's Year using javascript.
Tried with VF page by injecting into the component console.
But due to cross-domain security issues,not able to do.
Any other ways...
 
Hi.

I have a inline VF Page in the standarad Page.
The user edits a field in the standarad Page using inline.
Now the standarad page show save and cancel button.

The user never saved the standarad Page,but he goes to some action by clicking the button  in the Inline VF Page.
When the user clicks button in the InlineVF Page,I need to alert that the standarad Page has not be saved.

Cant get any thing from url key like e?retURL.
I was trying to get the document.elementbyId,getElementsByTagName,document.getElementsByClassName to check whether the 
standarad save button display stlye block.


Standarad Save button:
<input class="btn" type="button" onclick="sfdcPage.save();" name="inlineEditSave" style="display: inline;" title="Save" value="Save ">

Inline VF Page button:

<input class="btn" type="submit" value="Save" name="j_id0:mtmrHeaderform:j_id8">




Hi.

When you popup window using the fucntion "openPopupFocusEscapePounds" take care that
there is no unwanted space in url or in title.

I had a space in the title like this

openPopupFocusEscapePounds('google.com','testpage ',...other parmeters...)

The space in the title made the popup to close,no error is displayed and pop up cant open.
After deleting the space in the title,it worked.

Best Regards
suresh

Hi.

Is it possible to add css directly to a component like this.

<apex:component >
       <style type="text/css">
                  td{
                    style="height:10"
                      }
      </style>
     <table>
           <tr>
           <td>Test</td>
           </tr>
    </table>
</apex:component>


Best Regards
suresh
AND (
Effective_End_Date__c >= Effective_Start_Date__c ,
(Effective_Start_Date__c - today()) == 1
)

The above rule is not firing.
Will the below code works in workflow 
Effective_Start_Date__c - today()) == 1 

Hi.

 

I have 3 fields.

StartDate

EndDate

Active(checkbox).

 

Is it possbile to obtain Active to checked and unchecked by looking at the date every time when the 

startdate/ enddate is modified.

 

I was able to uncheck after 1 day of enddate. 

But not able to do check and uncheck  when ever the start date and end date is changed.

 

regards

suresh

I am searching for a seasoned Salesforce.com professional.  I recruit for Safari Books Online.  We are an established technology company that has enjoyed double digit growth year over year for more than a decade.  In the last two years we have doubled in size and our innovation continues to fuel our growth.

 

This position will be based in our Boston office in the Seaport / Innovation District. Below is a job and company description.

 

Interested in learning more? If so, please send me an updated copy of resume and I’ll touch base with you.

 

James

 

James Nekton

Senior Recruiter

Safari Books Online

707-827-3055

jnekton@safaribooksonline.com

 

 

 

Salesforce.com Developer – All New Development

 

This is an outstanding opportunity for the seasoned engineer with solid Force.com, Visualforce, and Apex skills to help design and develop a wide variety of new initiatives that will dramatically increase the power of our Salesforce.com platform.

 

Based in our Boston office in the Seaport / Innovation District (Farnsworth Street) you will have a high level of autonomy in our relaxed but innovative environment.  Our engineering team is a group of life-long learners that is not married to a particular technology, methodology or job description, instead we encourage innovation, exploring the latest technology for elegant, efficient solutions, and tackling and solving all technical challenges.  If this sounds like an environment and role in which you would thrive then please submit your resume for consideration.

 

Safari Books Online is investing heavily in bringing all our customer data into Salesforce.com to create the CRM holy grail - a 360 degree view of our customers which enables all of our departments to be more amazing.  

 

Here is a small sample of our current initiatives:

 

- Ensuring Salesforce contains all of our customer’s basic information from our various product platforms.  This involves batch sync operations as well as near-realtime API interactions

 

- Instrumenting all of our various customer touches in such a way that they can be “stapled” back to the customer record in Salesforce

 

- Implementing strategies to de-duplicate customer records.  This includes merging and preventing duplicates

 

- Make customer service and tech support reps thrilled by replacing manual Salesforce processes with “easy buttons” to do the work for them.  This includes billing tasks, provisioning of accounts, and customizing the new Case Feed feature

 

- Help to develop an architecture to segment customers and create personalized emails

 

- Develop “crowd-sourced” Customer Support Portals using force.com sites and Salesforce Communities

 

- Streamline our title request workflow, where customers request titles and we work with Publishers to deliver them


- Help to create better product feature and pricing management, so the Sales department can generate Quotes and Orders a little faster and more easily

 

- Explore transitioning to VisualForce/PDF solutions to replace word documents

- Develop Enterprise mobile apps, using salesforce as the backend, to enable our Sales Reps to be more productive on the go

Products and Technologies you get to work with:

 

- Salesforce (All aspects: Service, Sales, Marketing, Platform)

- Marketo

- force.com sites (Leveraging standard web technologies, CSS/jQuery, etc)

- Salesforce Communities

- CRMfusion’s DemandTools

- Apex

- Visualforce

- Zoura subscription management

- Google Cloud Platform

- Various platforms on our local servers (python/php/mysql/hadoop)

About us:

Safari Books Online provides subscription-based training resources to thousands of professionals interested in learning about topics such as IT, software development, graphic design, business and professional development. The company offers services for individuals, businesses, government and libraries and sells both direct to users/groups and through resellers. For users, the advantages of our subscription model include:

  • Unlimited learning from 30,000+ books/videos from more than 100 leading publishers
  • Synched access across virtually any platform, including PC, Mac, iPhone, iPad, Android and other devices with a browser
  • Always current content about the hottest topics, often available before physical books hit store shelves
  • Tools to quickly find, organize, manage, and share the information in our library

For today’s leading publishers, Safari Books Online serves as an increasingly important sales channel, delivering usage-based royalties primarily through corporate and institutional sales to complement revenue in today’s competitive book-selling environment.

 

 

 

 

 

Hi.

I can export the csv file with line feed('\n').

How to export with CRLF ('\r\n').

 

any idea greatlt appreictaed

regards

suresh

I am trying to call a Flow (not workflow but flow) from inside a trigger:

trigger OpportunityTriggerAfter on Opportunity (after insert,after update) {
public Flow.Interview.Update_Opportunity_w_Favorite_Venue_Info fl;
for(Opportunity o:Trigger.New){

if(Trigger.isInsert){
   		                     
fl.vaOpportunityID = o.Id;

}
}

 although I'm not certain if you can do this or if this is even the correct syntax. I'm also getting a CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY error even though the flow I am calling doesn't perform an update on the Opportunity but instead only takes the opportunity ID as a starting parameter. If I try fl = new Flow.Interview.Update_Opportunity_w_Favorite_Venue_Info(o.Id); I get a constructor not defined error even though this can be done in the following doc: http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_flows_advanced.htm

My questions are:

1.) Is this even possible? If so what is the syntax (do I have the correct syntax)?
2.) Why am I getting the CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY error?

Hi.

 

Is there any way not to share all the content files with other users.

I like know to sharing setting with respect to file ,not with respect to the libray folder.

 

cheers

suresh

Hi.
 
Im sending mail throughtApex,the receiver mail has somethings like
 
from: tester@gmail.com via dcs9hayusmal.o-uuh3mag.o.bnc.sandbox.salesforce.com
 
I need to hide/disable the below when sending the mail from Apex.
" via dcs9hayusmal.o-uuh3mag.o.bnc.sandbox.salesforce.com "
 
cheers
suresh

I have the following code:  (Note, it is part of a future-call method)

 

 

...
String EmailFailure = null;
	
try {
	Messaging.SendEmailResult[] mailResult = Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
	if ( !mailResult[0].isSuccess() ) {
		EmailFailure = 'Email Failed: ' + mailResult[0].getErrors()[0].getMessage();
	}
}
catch(DmlException dmlEx) {
	EmailFailure = 'Email Failed: ' + dmlEx;
}
	
if ( EmailFailure != null ) {
...

 

 

It is failing with the following error whenever an attempt is made to send to a contact with an invalid (bounced) email address.

 

Failed to invoke future method 'public static void SendSurvey(String, Id, Id, Id, Id, Id, String, String)' on class 'Survey_Controller' for job id '70730000003xhE1'

caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, email address has bounced for id : 0033000000VqJyN: []

 

 

How can I capture the error gracefully instead of getting this error message?  I thought if I wrapped it with try/catch it would work.

 

Thanks,
Paul

I am using apex:outputField(..) with a standard object and display textwith linebreaks. That output reflects the linebreaks nicely.

After that I need to compile a list of data from activities which Ido in a custom object (see code below). That data can only be displayedwith apex:outputText. I made sure that \r\n is in the string (seecode), but it does not break the lines.
In the code you will find that I arteficially entered theseescaped characters and a line before and after ("|\r\n|"). In thedisplay, ist shows some space between those 2 lines. That indicatesthat the \r\n are not suppressed, but not used in apex:outputText. Ialso tried to arteficially use </br>, but that is printed ratherthan uased as HTML break.
How do I get linebreaks in apex:outputText ??

Thanks for your help.

-------------- 8< cut! -------------------------------------------------------------------------------
VF page:

<apex:page tabstyle="Case" controller="Report1"
standardStylesheets="false" showHeader="false">
<apex:stylesheet value="{!URLFOR($Resource.printstyles, 'printstyles.css')}" />

<apex:pageBlock title="Zwischenbericht ({!Case.CaseNumber})" mode="detail" id="pageblock">
<apex:pageMessages />

<div id="massfields">
<div id="masssection">
<div id="masslabel"><apex:outputLabel for="descr" value="Bemerkung" /></div>
<div id="massline"><apex:outputField value="{!case.Description}" id="desc" />&nbsp;</div>
<!-- ^^^ This output shows new lines as wanted -->
</div>
</div>

<apex:pageblockSection title="Aktivitäten">
<apex:repeat value="{!kontaktInfo}" var="kontakt" id="task">
<div id="activitydescription"><apex:outputTextvalue="{!kontakt.Description}" />&nbsp;</div>
<!-- ^^^ This output DOS NOT show new lines as wanted -->
</apex:repeat>
</apex:pageblockSection>

</apex:pageBlock>

</apex:page>

--------------------------------------------------------------------------------
Controller:
public with sharing class Report1 {

private Case locCase;
private List<Involvierte_Partei__c> invParty;
private BOKontaktInfoLister kontaktlist;

public Report1(){

String id = ApexPages.currentPage().getParameters().get('id');
buildDataStructure(id);

}

public Report1(String id){
buildDataStructure(id);
}

private void buildDataStructure(String id){

locCase = [..];
kontaktList = new BOKontaktInfoLister(id);

}

public Case getCase(){
return locCase;
}

public List<DOKontakt> getKontaktInfo(){
return kontaktList.getKontaktInfo();
}

}

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

public class BOKontaktInfoLister{

private List<Task> tasks;
private List<Event> events;
private List<DOKontaktInfo> kontaktList; //DOKontaktInfo is just a DataObject

public BOKontaktInfoLister(String id){

kontaktList = new List<DOKontaktInfo>();

tasks = [Select t.ActivityDate, t.Account.PersonMobilePhone,t.Account.PersonHomePhone, t.Subject, t.Id, t.Description From Task twhere t.What.Id = :Id order by t.ActivityDate asc];

events = [select e.ActivityDate, e.Account.PersonHomePhone,e.Account.PersonMobilePhone, e.Subject, e.Id, e.Description From Evente where e.What.Id = :Id order by e.ActivityDate];

for(Integer i = 0; i< tasks.size(); i++){
DOKontakt kon = new DOKontakt();
kon.id = tasks[i].Id;
...
//kon.description = tasks[i].Description; // real statement
kon.description = 'Line1\r\n</br>Line2'; // this is just mytest to be sure that I have line breaks in the text
kontaktList.add(kon);
}

for(Integer i = 0; i< events.size(); i++){
DOKontakt kon = new DOKontakt();
kon.id = events[i].Id;
...
//kon.description = events[i].Description; // real statement
kon.description = 'Line1|\r\n|Line2'; // this is just my test to be sure that I have line breaks in the text
kontaktList.add(kon);
}

}


public List<DOKontakt> getKontaktInfo(){
return kontaktList;
}


}


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

public class DOKontakt{
public String id;
public Date activityDate;
public String subject;
public String name;
public String privPhone;
public String mobPhone;
public String description;

public String getId(){
return id;
}

public Date getActivityDate(){
return activityDate;
}

public String getSubject(){
return subject;
}

public String getName(){
return name;
}

public String getPrivPhone(){
return privPhone;
}

public String getMobPhone(){
return mobPhone;
}

public String getDescription(){
return description;
}

  • January 28, 2010
  • Like
  • 0