• DHO_604
  • NEWBIE
  • 50 Points
  • Member since 2009

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

Hi,

 

Could you please shed some light on calling a visual workflow on a VF Page?  Ideally I'm looking to add a button on the VF page to invoke the visual workflow.  Is there a way to call it like using a custom button by setting the content source = 'URL' and then just type in the URL of the flow, or would I have to write a controller and invoke the method there?

 

TIA

 

D

I am looking to add the cases related list to my customer portal home page layout, and it's not trivial.  Is there a way to do this by setting up a home page component?

 

I know I can create a custom VF page to do this, but is there a way to remove the home page tab if I go down this path?

 

TIA

 

D

I have an image that is set as externally available, I was able to view it if I punch in the url into my browswer.  However if I wrap it with the img src tag and dump it into an html file it doesn't render.  

 

The url to the image is like this:

https://na1.salesforce.com/servlet/servlet.ImageServer?id=[docId]&oid=[orgId]

 

the img tag is like this:

<img src=”https://na1.salesforce.com/servlet/servlet.ImageServer?id=[docId]&oid=[orgId]”>

 

What am I doing wrong here?

I'm overriding the create new case record by creating a new VF page, and if the creator is internal then make him select the record type.  However the VF page gives me the 'Expression value does not resolve to a field' error when I added the recordtype field onto the page.

 

This is what I did on the VF page:

 

 <apex:form >
      Select a Record Type:&nbsp; <apex:inputField value="{!Case.RecordType}"/>
  </apex:form> 

 

What did I do wrong?

 

TIA,

 

D

Dear gurus:

 

How do I set up salesforce to bypass the choose case record type page when creating case on customer portal

 

TIA,

 

D

Dear Apex friends,

 

Is there anyway to get around the "too many callouts: 11" problem when I cannot bulkify my callouts?

 

TIA

 

D

My JSON parsing code runs properly in my Sandbox env.  However when I ported it to Production I get this message: "Don't know the type of the Apex object to deserialize"

 

Help!

I have the following code that calls the standard pricebook selection page out of salesforce.  However, after selecting the pricebook, the pricebook value is saved on the opp and not the quote where this call originates from.  Can someone provide some pointers to get the pricebookid back into the quote? Cheers!

 

<apex:page standardController="Quote" extensions="ProductPicker" action="{!addPriceBookError}" >
<apex:form >

<apex:sectionheader title="Error missing Pricebook on opportunity" subtitle="{!quote.opportunity.name}" />
<apex:pageMessages /><h2>
<apex:commandlink oncomplete="window.location.href='/oppitm/choosepricebook.jsp?id {!quote.Opportunity}&retURL=%2F{!quote.id}&sUrl=%2F{!quote.id}';"  value="Select price book now" /></h2>
</apex:form>
</apex:page

Hi,

 

I have a VF email template and would like to use another VF Page as a pdf attachment.  It'd be great if you can shed some light on how to do this.

 

TIA!

I have very simple VF Page rendered as a pdf with a section where I set inline style with margins using the following code:

 

<div style="margin-left:250px; margin-top:250px;">
 <apex:panelGrid columns="1" width="100%" >                       
    
        <apex:outputText value="Some Text" id="some text"/>
                
</apex:panelGrid>
</div>

 

The margin left property worked, however the margin-top property did not.  Could someone shed some light on this?

 

Thanks!

 

Is it possible to create a close case button on the case list view to point to a custom VF close case page?  If so could you please provide some guidance on how to do this?

 

Thanks!

I have a rather large image file that spans multiple pages when I render the visualforce page as a pdf file.  Is there anyway to get the image to fit into one page by using a visualforce command.  

 

Also, is there any way to display text on top of the image file? ie use the image as a background?

 

Thanks.

I'm getting stuck on referencing unrelated tables using a SOQL query.

 

For example I have a Leads table that has a country field, and I need to reference to a Mapping Table that contains the currency code for the country, and update the lead's currency code with the value from the Mapping table.  How would I approach this?

 

I started with a map that looks like this:  LeadMap<id, string> where the id is the lead's id and the string contains the country code.  I'm not sure how to approach the rest of the problem as I really need to end up with a map of <id,id> that contains the lead Id and the currency id.

 

Any help will be greatly appreciated.

I have very simple VF Page rendered as a pdf with a section where I set inline style with margins using the following code:

 

<div style="margin-left:250px; margin-top:250px;">
 <apex:panelGrid columns="1" width="100%" >                       
    
        <apex:outputText value="Some Text" id="some text"/>
                
</apex:panelGrid>
</div>

 

The margin left property worked, however the margin-top property did not.  Could someone shed some light on this?

 

Thanks!

 

I have an image that is set as externally available, I was able to view it if I punch in the url into my browswer.  However if I wrap it with the img src tag and dump it into an html file it doesn't render.  

 

The url to the image is like this:

https://na1.salesforce.com/servlet/servlet.ImageServer?id=[docId]&oid=[orgId]

 

the img tag is like this:

<img src=”https://na1.salesforce.com/servlet/servlet.ImageServer?id=[docId]&oid=[orgId]”>

 

What am I doing wrong here?

I'm overriding the create new case record by creating a new VF page, and if the creator is internal then make him select the record type.  However the VF page gives me the 'Expression value does not resolve to a field' error when I added the recordtype field onto the page.

 

This is what I did on the VF page:

 

 <apex:form >
      Select a Record Type:&nbsp; <apex:inputField value="{!Case.RecordType}"/>
  </apex:form> 

 

What did I do wrong?

 

TIA,

 

D

Dear gurus:

 

How do I set up salesforce to bypass the choose case record type page when creating case on customer portal

 

TIA,

 

D

Dear Apex friends,

 

Is there anyway to get around the "too many callouts: 11" problem when I cannot bulkify my callouts?

 

TIA

 

D

My JSON parsing code runs properly in my Sandbox env.  However when I ported it to Production I get this message: "Don't know the type of the Apex object to deserialize"

 

Help!

I'm an OAuth noob and strugging to get a login page to pop up where Apex is the client and GoToWebinar is the Service.  How do I make the login screen pop up?  Does it somehow magically take over the VF page via redirect or do I need some javascript to open a new window?  Below is my attempted approach using HttpRequest:

 

My first attempt is something like this:

public class G2WButtonController{
    public G2WButtonController(ApexPages.StandardController stdController){
    }
    
    //Code that will run upon button click
    public void autoRun(){
        callG2W(args);
    }

    public static void callG2W(String[] args) 
    {
        String postURL='https://api.citrixonline.com/oauth/authorize?client_id=<myClientId>';
        Http http = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(postURL);
        req.setMethod('POST');
        HttpResponse res = http.send(req);

        //Class to parse the results
        XmlStreamReader reader = res.getXmlStreamReader();
    }
}

 VF

<apex:page standardController="G2W_Login__c" extensions="G2WButtonController" action="{!autoRun}">
  <apex:pagemessages />

    <apex:sectionHeader title="Auto-Running Apex Code"/>
  <apex:outputPanel >
      You tried calling Apex Code from a button.  If you see this page, something went wrong.  You should have
      been redirected back to the record you clicked the button from.
  </apex:outputPanel>

</apex:page>

 Once I get the login page to pop up, I'm assuming I would then parse the HttpResponse to get a param from the redirect URL- is that correct?

 

Any code samples others have would be greatly appreciated!

I have the following code that calls the standard pricebook selection page out of salesforce.  However, after selecting the pricebook, the pricebook value is saved on the opp and not the quote where this call originates from.  Can someone provide some pointers to get the pricebookid back into the quote? Cheers!

 

<apex:page standardController="Quote" extensions="ProductPicker" action="{!addPriceBookError}" >
<apex:form >

<apex:sectionheader title="Error missing Pricebook on opportunity" subtitle="{!quote.opportunity.name}" />
<apex:pageMessages /><h2>
<apex:commandlink oncomplete="window.location.href='/oppitm/choosepricebook.jsp?id {!quote.Opportunity}&retURL=%2F{!quote.id}&sUrl=%2F{!quote.id}';"  value="Select price book now" /></h2>
</apex:form>
</apex:page

Is it possible to create a close case button on the case list view to point to a custom VF close case page?  If so could you please provide some guidance on how to do this?

 

Thanks!

I have a class which does HTTP callouts.  Because I am needing to do more than 10 callouts at a time, I am using a Batch class to call that class.  At this point, I can call that class without issue by directly calling the batch execute via system log.  The next step I need to do is put the Batch in a scheduler that runs every hour.  So I now have 4 classes:

 

1.) My original class that does the HTTP callouts

2.) The batch class which calls #1 scoped one record at a time to avoid the 10-callout limit

3.) A schedulable class which executes the batch class and has a method to invoke system.scheduler

 

But now I'm stuck because it seems no matter how I organize things, I get one of these errors:

 

1.) Future method cannot be called from a future method (I'm getting this one with my current code setup)

2.) You have uncommitted work pending (I get this one if the callout method isn't a future method)

3.) Too many callouts - 2 (I get this one if I make the callout method NOT a future method and somehow try to update the assets all together in the batch class)

 

What the heck am I supposed to do to get this class scheduled??  Below is my code.

 

Class #1: The HTTP Callout Class

global class VLStatus {

 

  @future(callout=true)
   global static void getMachineStatus(String asstId){

        Asset asst = new Asset();
        asst = [select id, name, SerialNumber from Asset where Id = :asstId];

 

       //code that does my callout stuff and sets the asset fields

      update asset;

  }

 

Class #2: The Batch Class

global class VLStatusBatch implements Database.Batchable<Asset>, Database.AllowsCallouts{

//Get list of machines that we are still waiting on for a response
Asset[] AssetsToUpdate = [Select id, name, SerialNumber from Asset where Pending_VL_Response__c = 1];

global Iterable<Asset> start(database.batchablecontext BC){
    return (AssetsToUpdate);    
}

global void execute(Database.BatchableContext BC, List<Asset> scope){
    for(Asset a : scope){
            VLStatus.getMachineStatus(a.Id);
    }    
}

global void finish(Database.BatchableContext info){
    }//global void finish loop

}

 

 

 

Class #3: The Schedulable Class

global class HourlyScheduler implements Schedulable{
    global HourlyScheduler (){}

    public static void start(){
        //Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
        System.schedule('Pending Machine Status Update', '0 5 1-23 * * ?', New HourlyScheduler());

    }

    global void execute(SchedulableContext ctx){
        VLStatusBatch b = new VLStatusBatch();
        database.executebatch(b);    
    }
}

 

I'm getting stuck on referencing unrelated tables using a SOQL query.

 

For example I have a Leads table that has a country field, and I need to reference to a Mapping Table that contains the currency code for the country, and update the lead's currency code with the value from the Mapping table.  How would I approach this?

 

I started with a map that looks like this:  LeadMap<id, string> where the id is the lead's id and the string contains the country code.  I'm not sure how to approach the rest of the problem as I really need to end up with a map of <id,id> that contains the lead Id and the currency id.

 

Any help will be greatly appreciated.

We're building a custom integration with SF Knowledge where we need to use some, but not all of the Case functionality.  We like the Attach to Case stuff, but we don't like the Email as PDF stuff, so my plan was to upsert a solution for each Knowledge Article, and then insert an entry into the CaseSolution object for each one, so we could use the existing solutions merge field for the email templates (and also not have to update a couple dozen email templates while we're at it).

 

I don't see any accessible metadata in regards to querying, or even better, triggering on article attachment to Case.  Is there a way to get this info as of the Summer '10 release, or are we stuck in having to essentially build out an end to end custom solution for this type of integration?  I don't like going custom when it comes to page layouts, because Visualforce on a standard page layout is an ugly iframe implementation, which limits the functionality I can put in due to vertical space constraints (and my not wanting to waste vertical space).

 

Any insight would be appreciated.

 Hello,

 

I have a process that automatically builds a scheduled job a few minutes in the future every time it fires.  This works great, but after there are ten such jobs, I get an Apex limit exception: You have exceeded the maximum number (10) of Apex scheduled jobs.

 

These jobs are all completed and I did check to make sure they have a status of 'COMPLETED' as well.  When I delete them by going in through the UI, then the process works again.

 

1. Is this intended behavior? 

 

2. Is there any way to programatically delete these old completed jobs?

Message Edited by jhartfield on 02-12-2010 02:35 PM
Message Edited by jhartfield on 02-12-2010 02:35 PM