• AUEagle
  • NEWBIE
  • 10 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies

I am building a custom search page which calls a custom report which I have created.  The report is assigned a unique Id at the time of creation.  The report Id assigned in my test sandbox is '/00OT00000017uln?' and I am able to call the report and pass parameters by using the following: sURL = '/00OT00000017uln?' + Filter + '&retURL=/apexCustomSearch?sfdc.tabName=01rT0000000DEIN';
        PageReference pageRef = new PageReference(sURL);
       return pageRef;

 

However, when I move to a production environment, the unique ID will be different although the assisgned name will be the same.  Is there a way I can call the report using the assigned name or retrieve the unique ID using the report name?

I have written a javascript that I inserted into the "Execute Javascript - OnClick JavaScript" that is attached to a "Create New Event" button on my contacts Page.  When I scroll down to the Activities section on my contact page and click on the "Create New Event" button, an new event page opens up in the existing window without any problem.  However, if I hover over the "Open Activites" link at the top of the page,  the small popup window with the Open Activities buttons appear.  When I click on the "Create New Event" from within this popup box, my new event page attempts to open within the popup box.  How can I test to check if I am in the popup window in my javascript code.  I presume I will have to close the popup window before attemptiing to open the event window, but I don't know how to test whether I am in the popup window or not.  Here is the code I currently have to open the window.

 

//open the event window in the current window

window.location="/"+"00U/e";

 

//what I think I want to do is something like this

if (i am currently in a popup window)

    close the popup window;

    open the event window.location

 

 

I am trying to draw a line on a VF page that I can adjust the thickness of.  I have tried the following:

 

<hr size="7" /> and <hr height="20">

 

But the line thickness seems to stay the same regardless of what values I use.   Any help would be appreciated.

Thank You.

I am trying to render a PDF page using a text field value that currently has <br /> as part of the text field and still maintain the newlines breaks where the existing breaks exist.   For example, I have a field named Other_Contact_Name__c with a value:  My Name<br />3312 Hard Rock Court<br />Richmond, VA  23230

 

I want to render the field on a PDF so that the output apears as:

My Name

3312 Hard Rock Court

Richmond, VA  23230

 

I have tried this:

<apex:outputText value="{!SUBSTITUTE(Case.Other_contact_name__c,'<br />', '\r')}/>

 

I have also tried replacing with '\n', '\r\n' but the output simply is displaying whatever value I try to substitue.  Any help would be greatly appreciated.

 

I am trying to draw a line on a VF page that I can adjust the thickness of.  I have tried the following:

 

<hr size="7" /> and <hr height="20">

 

But the line thickness seems to stay the same regardless of what values I use.   Any help would be appreciated.

Thank You.

I am trying to render a PDF page using a text field value that currently has <br /> as part of the text field and still maintain the newlines breaks where the existing breaks exist.   For example, I have a field named Other_Contact_Name__c with a value:  My Name<br />3312 Hard Rock Court<br />Richmond, VA  23230

 

I want to render the field on a PDF so that the output apears as:

My Name

3312 Hard Rock Court

Richmond, VA  23230

 

I have tried this:

<apex:outputText value="{!SUBSTITUTE(Case.Other_contact_name__c,'<br />', '\r')}/>

 

I have also tried replacing with '\n', '\r\n' but the output simply is displaying whatever value I try to substitue.  Any help would be greatly appreciated.

 

Hello,

 

I have developed a trigger on Attachments. My idea is to update a case field when a new attachment is insert on a case. It works OK, not perfect.

 

I can't deploy it to production because I'm not able to create a test class for it... I tried but I'm only starting with Apex now. The code is below, can someone help me build a test class for it?

 

 

trigger NewAttachment on Attachment (before insert) {List<Case> CasesToUpdate = new List<Case>();for (Attachment t: Trigger.new){try{Case c = new Case(Id = t.ParentId);c.HasAttachments__c = true;CasesToUpdate.add(c);}catch (Exception e) {}}update CasesToUpdate;}//end

 

Thanks! 

 

 

This is my first APEX coding... and, I need a bit of help. 

 

I am trying to count the # of related records...

 

I'd then, like to make a field on the current record equal to this count.

 

The following seems to work well... except I don't know how to limit the select statement to where the related_id = the id of the current record.  How do I make the variable "sid" = the id on the current record on the object Students?  Also, do I need a "loop" -- if so, how would this look?

 

Many thanks!

 

trigger CountRelatedCallLogs on Student__c (before insert, before update) { Student__c[] s = Trigger.new; String sid = null; Sid = s.id; LIST <Student_Call_Log__c> log = [SELECT Id, Related_Student__c, Date__c, Note__c FROM Student_Call_Log__c clog WHERE Student_Call_Log__c.Related_Student__c = :sid ORDER BY Related_Student__c, Id DESC LIMIT 1000]; s[0].Call_Count__c = log.size (); s[0].Most_Recent_Call_Note__c = sid(); }

 

 

  • January 19, 2010
  • Like
  • 0