• Susana NTS
  • NEWBIE
  • 25 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 13
    Replies

Hi all,

 

I would like to show, in the home page, a Salesforce custom report, the list of tasks and the calendar. From the report I want to show only its chart or if that's not possible, only the details of the report, that is not displaying the Salesforce header nor the filters section.

 

To achieve this, I have created a HTML component with an iframe and some javascript code lines. The iframe src attribute is the custom report id. This, obviously, works fine. The problem comes when I try to get the iframe window and scroll it right to the chart position.

 

The Home Page component content is:

 

<iframe id="reportVN" src="/00OS0000000d8yQ" width="100%" scrolling="no" frameborder="0" height="350"></iframe><script type="text/javascript"> var marco = parent.document.getElementById("reportVN"); marco.contentWindow.scrollTo(0, 1000);</script>

 

This code does nothing at all.

If I put an alert to see if I can access the iframe by its ID, I get the iframe properly. I tried to change its visibility to see if I was able to change the iframe attributes, and it worked.

So I put the scrollTo() function (the last line in the code sample) inside an alert and all I got was an "undefined" message.

 

Any ideas on this issue??

 

Thanks,

 

Susana 

 

 

 

 

Hi,

 

I've developed an InboundEmailService Class which receives an email with an XML in its body.

This class gets the plainTextBody out of the email and then parses its content.

 

One of the tag of the XML is this:

 

<OpenDate>2008-02-25 00:00:00</OpenDate> 

 

When sending an email to the salesforce email address, I receive this email with an Exception right in the line where the parser processes that date:

 

>>> hojasdeproyecto@4b9l8nski5qzkyszl2ghlui4j.in.sandbox.salesforce.com (Undelivered): 554 System.TypeException: Invalid date:                            

Class.ParserHojaProyecto.parsearDetalle: line 171, column 24

Class.ParserHojaProyecto.parsearDatos: line 131, column 7

Class.ParserHojaProyecto.parsearEmail: line 43, column 3

Class.RecepcionEmailHojaProyecto.handleInboundEmail: line 28, column 13 External entry point

 

The line where the code throws the exception is:

p.Open_Date__c = Date.valueOf(datos.get(0)); 

 

It seems to me that the parser is taking a blank space as the date value (maybe the one between the date and the time).

 

The weird thing is all my test methods do execute perfectly and the parser extracts every single value as it has to do. Also, the XML I'm using in the email is exactly the same I'm using in the test methods.

 

Any Idea why the development works fine in test methods and does not when sending the physical email?

 

Thanks in advance,

 

Susana

Hi,

 

I need to overwrite the behaviour of the New button (for several objetcs).
The new behaviour should just not allow the creation of a new record and show a concrete message to the user warning about that.

The problem is that I'm not able to avoid the recordtype selection step because, even if I specified a value for the page "action" property, it executes first the recordtype selection step and then my action.
Is it possible to skip the recordtype selection step with a visualforce page? I know how to do it with s-controls but I need Visualforce here.

 

Thanks in advance,

 

Susana

Hi all,

 

I would like to show, in the home page, a Salesforce custom report, the list of tasks and the calendar. From the report I want to show only its chart or if that's not possible, only the details of the report, that is not displaying the Salesforce header nor the filters section.

 

To achieve this, I have created a HTML component with an iframe and some javascript code lines. The iframe src attribute is the custom report id. This, obviously, works fine. The problem comes when I try to get the iframe window and scroll it right to the chart position.

 

The Home Page component content is:

 

<iframe id="reportVN" src="/00OS0000000d8yQ" width="100%" scrolling="no" frameborder="0" height="350"></iframe><script type="text/javascript"> var marco = parent.document.getElementById("reportVN"); marco.contentWindow.scrollTo(0, 1000);</script>

 

This code does nothing at all.

If I put an alert to see if I can access the iframe by its ID, I get the iframe properly. I tried to change its visibility to see if I was able to change the iframe attributes, and it worked.

So I put the scrollTo() function (the last line in the code sample) inside an alert and all I got was an "undefined" message.

 

Any ideas on this issue??

 

Thanks,

 

Susana 

 

 

 

 

Hello everyone!

 

Using an Appex trigger we like to add a record in sharing table. The user who update the record that trigger the appex is not the owner so the trigger fail.

We would like to know is it possible to run a trigger from the owner of the record despite the user that modify the record that trigger "the trigger" had only read/write access.

 

 

 

Regards. 

Hi,

 

I've developed an InboundEmailService Class which receives an email with an XML in its body.

This class gets the plainTextBody out of the email and then parses its content.

 

One of the tag of the XML is this:

 

<OpenDate>2008-02-25 00:00:00</OpenDate> 

 

When sending an email to the salesforce email address, I receive this email with an Exception right in the line where the parser processes that date:

 

>>> hojasdeproyecto@4b9l8nski5qzkyszl2ghlui4j.in.sandbox.salesforce.com (Undelivered): 554 System.TypeException: Invalid date:                            

Class.ParserHojaProyecto.parsearDetalle: line 171, column 24

Class.ParserHojaProyecto.parsearDatos: line 131, column 7

Class.ParserHojaProyecto.parsearEmail: line 43, column 3

Class.RecepcionEmailHojaProyecto.handleInboundEmail: line 28, column 13 External entry point

 

The line where the code throws the exception is:

p.Open_Date__c = Date.valueOf(datos.get(0)); 

 

It seems to me that the parser is taking a blank space as the date value (maybe the one between the date and the time).

 

The weird thing is all my test methods do execute perfectly and the parser extracts every single value as it has to do. Also, the XML I'm using in the email is exactly the same I'm using in the test methods.

 

Any Idea why the development works fine in test methods and does not when sending the physical email?

 

Thanks in advance,

 

Susana

Hi,

 

I need to overwrite the behaviour of the New button (for several objetcs).
The new behaviour should just not allow the creation of a new record and show a concrete message to the user warning about that.

The problem is that I'm not able to avoid the recordtype selection step because, even if I specified a value for the page "action" property, it executes first the recordtype selection step and then my action.
Is it possible to skip the recordtype selection step with a visualforce page? I know how to do it with s-controls but I need Visualforce here.

 

Thanks in advance,

 

Susana

I have a very simple Batch class and I am trying to write a unit test to cover it but the execute method in this batch class is never executing. I'm stumped.

 

Batch Class:

global class ideaCleanBatch implements Database.Batchable<sObject>{

global Database.QueryLocator start(Database.BatchableContext bc){
//We want to process all Ideas
return Database.getQueryLocator('select Id from Idea');
}

global void execute(Database.BatchableContext bc, List<sObject> objects){
Set<Id> ideaIds = new Set<Id>();
for(sObject s : objects){
Idea i = (Idea)s;
ideaIds.add(i.Id);
}
//Send ideas to ideaClean for processing
ideaClean.recalcNumbers(ideaIds);
}

global void finish(Database.BatchableContext bc){
system.debug('All done.');
}
}

Test Method:

static testMethod void ideaBatchTest(){
List<Idea> ideas = new List<Idea>();
Id communityId = [select Id from Community limit 1].Id;
for(Integer i = 0; i < 200; i++){
ideas.add(new Idea(Title = 'myIdea' + i, CommunityId = communityId));
}
insert ideas;

Test.startTest();
ideaCleanBatch job = new ideaCleanBatch();
ID batchprocessid = Database.executeBatch(job);
Test.stopTest();
}

Coverage:

 

Thanks,

Jason

 

  • October 30, 2009
  • Like
  • 0

How to store variables in Session and how to access that Session Variable in Apex Page & in Contoller?.
 
Regards,
KK 

Hi,

 

Is there any way to reference a staticresource image from css that's been uploaded as a static resource?

 

 

I'm creating events in an apex routine, and also need to create some "group events" (with multiple users invited.)

So my code creates an event, gets the id, then adds child EventAttendee records.  It works- so far so good. 
The problem is that it seems to always cause emails to get sent to the users invited.  When adding invitees via the UI, there's two options - SAVE, and SAVE AND SEND UPDATE.  The latter seems to send an email while the former doesn't.

With Apex/API I don't see how to make the same thing happen.  Is there a field in either object I can set to avoid sending the email?

Thanks much!


  • December 12, 2007
  • Like
  • 0