• James Carbone
  • NEWBIE
  • 5 Points
  • Member since 2010
  • VP of Software Development
  • Marsh ClearSight


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

Hi,

 

I've been trying to get a Visualforce page to output a PNG image.  For example, you hit the URL and the picture displays in the browser window.  The content-type setting appears to allow this sort of thing.  For example I was able to output a BMP with code similar to this:

 

VF page:

<apex:page controller="TileRedirector" contentType="image/bmp"  showHeader="false" sidebar="false">{!Content}</apex:page>

 

 

Controller snippet:

public string getContent()

{

    string content = 'BM:6( ##Ÿˇ';    

    return content;

}

 

 

When I try this with a PNG I get an invalid image.  My current thinking is that the content type for the page is outputs as image/png; charset=UTF-8;

 

I can force different charset's by adding the charset to my VF page without effect.  I'm reading the image from another source and can successfully view that image from their web site.  The difference is that the content type for those requess always respond as "image/png" without a char set specified.

 

Has anyone successfully returned a PNG from a VF page before?

 

Thanks,

Jim 

I have a scenario that creates 6 scheduled jobs so they run every ten minutes.  I store the cron trigger id so I can delete all the jobs by clicking a button rather than delete one at a time in the Setup module's Scheduled Jobs page.

 

I try to spin through the six jobs and call system.abort for each one, one at a time.  The debug logs show abort is called and there is no exception caught in my try block.  The problem is only the first job is actually deleted.

 

Here is my code:

 

for(My_Setting__c setting : settings)

{

    try

    {

       System.debug('--- Delete scheduled job with Job_Id = ' + setting.Value__c);

      System.abortJob(setting.Value__c);

   delete setting;

    }

    catch (Exception e)

    {

        System.debug('--- Unable to delete scheduled job with Scheduled_Geocoder_Job_Id = ' + setting.Value__c + ' because ' + e.getMessage());

    }

}

 

The setting is deleted, but 5 of the 6 jobs remain.

 

Here is a snippet from the debug logs:

 

 

12:10:17.456 (341086000)|USER_DEBUG|[119]|DEBUG|--- Delete scheduled job with Job_Id = 08e500000000HRJAA2

12:10:17.456 (341126000)|METHOD_EXIT|[119]|System.debug(ANY)
12:10:17.456 (341182000)|STATEMENT_EXECUTE|[120]|System.abortJob(String)
12:10:17.456 (341223000)|METHOD_ENTRY|[120]|System.abortJob(String)
12:10:17.474 (359183000)|METHOD_EXIT|[120]|System.abortJob(String)
12:10:17.474 (359252000)|STATEMENT_EXECUTE|[122]|Delete: SOBJECT:Map_Setting__c
12:10:17.474 (359321000)|HEAP_ALLOCATE|[122]|Bytes:8
12:10:17.474 (359365000)|DML_BEGIN|[122]|Op:Delete|Type:Map_Setting__c|Rows:1
12:10:17.474 (359514000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
12:10:17.498 (383561000)|DML_END|[122]

12:10:17.456 (341086000)|USER_DEBUG|[119]|DEBUG|--- Delete scheduled job with Scheduled_Geocoder_Job_Id = 08e500000000HRJAA212:10:17.456 (341126000)|METHOD_EXIT|[119]|System.debug(ANY)12:10:17.456 (341182000)|STATEMENT_EXECUTE|[120]|System.abortJob(String)12:10:17.456 (341223000)|METHOD_ENTRY|[120]|System.abortJob(String)12:10:17.474 (359183000)|METHOD_EXIT|[120]|System.abortJob(String)12:10:17.474 (359252000)|STATEMENT_EXECUTE|[122]|Delete: SOBJECT:Map_Setting__c12:10:17.474 (359321000)|HEAP_ALLOCATE|[122]|Bytes:812:10:17.474 (359365000)|DML_BEGIN|[122]|Op:Delete|Type:Map_Setting__c|Rows:112:10:17.474 (359514000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:812:10:17.498 (383561000)|DML_END|[122]

 

 

Hi All,

 

Currently, I'm doing some R&D on deployment in salesforce. I created a trail enterprice edition(60 day trial) to do those tests. And I created a sandbox for that production environment.  Doployment connection is ok.Then I have follow below test cases;

CASE 1:

 

  1. Created a custom object in sandbox
  2. created a outbound change set in sandbox and add the custom object with dependencies
  3. upload it to production environment
  4. Deployed in production environment

CASE 2

 

  1. Created a custom field for previous custom object in sandbox
  2. Created outbound Change set in sandbox and add the custom field with dependencies
  3. upload it to production
  4. deployed in production

CASE 1 is completed succesfully.

After complete CASE 2, the custom field has been added to the custom object in production environment. But that custom field is not in standard page that related to the custom object.

 

What is the issue?

 

Thanks in Advance

 

I have quoting set up and we have multiple price books but I would like to show the difference from the standard price and the list/sales price on the quote.  Is there a way to do this?

Hi,

 

I've been trying to get a Visualforce page to output a PNG image.  For example, you hit the URL and the picture displays in the browser window.  The content-type setting appears to allow this sort of thing.  For example I was able to output a BMP with code similar to this:

 

VF page:

<apex:page controller="TileRedirector" contentType="image/bmp"  showHeader="false" sidebar="false">{!Content}</apex:page>

 

 

Controller snippet:

public string getContent()

{

    string content = 'BM:6( ##Ÿˇ';    

    return content;

}

 

 

When I try this with a PNG I get an invalid image.  My current thinking is that the content type for the page is outputs as image/png; charset=UTF-8;

 

I can force different charset's by adding the charset to my VF page without effect.  I'm reading the image from another source and can successfully view that image from their web site.  The difference is that the content type for those requess always respond as "image/png" without a char set specified.

 

Has anyone successfully returned a PNG from a VF page before?

 

Thanks,

Jim 

If I have multiple workflows on a single object is there a way I can guarantee one will happen before another? For example when the stage changes to Closed Won,  I would like a field on the opportunity object to get updated (using a workflow) before the email gets sent out (also using a work flow).