• ood
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I All,

 

How I include external CSS file from web site to Visualforce Page?

 

I try this:

<link rel="stylesheet" href="http://www.xxx.com/assets/css/style.css" /> 

or 
<apex:stylesheet value="http://www.xxx.com/assets/css/style.css" />

 

But it don't work ..

 

Thanks,

 

ood

  • November 08, 2012
  • Like
  • 0

I have controller to access variable from flow when I create test class code coverage is to low because the can not access variable from flow in test class.Can help me to improve this test class.

The controller:

 

public with sharing class MinisiteFlow_Controller {

public String returnURL = ApexPages.currentPage().getParameters().get('rurl');

public Flow.Interview.MinisitePart1_1 MiniSiteFlow{get;set;}

public String lzsite{get;set;}

public String firstname{get;set;}

public String lastname{get;set;}

public String email{get;set;}

public String phone{get;set;}

public String state{get;set;}

public String partner{get;set;}

public String activityid{get;set;}

public String customerid{get;set;}

public Id SNEID{get;set;}

public PageReference getEndPage() {

PageReference send = new PageReference('/apex/MinisiteFlow_LastStep');

if(MiniSiteFlow != null){ 

    SNEID = MiniSiteFlow.SNEID;

  lzsite  = MiniSiteFlow.vEndPage;

firstname = MiniSiteFlow.vFirstName;   

lastname  = MiniSiteFlow.vLastName; 

    email  = MiniSiteFlow.vLeadEmail;   

    phone  = MiniSiteFlow.vPhone;

  state  = MiniSiteFlow.vState;

  partner  = MiniSiteFlow.vPartner;

  activityid  = MiniSiteFlow.vActivityId;

  customerid  = MiniSiteFlow.vCustomerID; 

    send.getParameters().put('rurl',EncodingUtil.urlEncode(returnURL==null?'':returnURL,'UTF-8'));

    send.getParameters().put('firstname',EncodingUtil.urlEncode(firstname==null?'':firstname,'UTF-8'));

    send.getParameters().put('lastname',EncodingUtil.urlEncode(lastname==null?'':lastname,'UTF-8'));

    send.getParameters().put('email',EncodingUtil.urlEncode(email==null?'':email,'UTF-8'));

    send.getParameters().put('phone',EncodingUtil.urlEncode(phone==null?'':phone,'UTF-8'));

    send.getParameters().put('state',EncodingUtil.urlEncode(state==null?'':state,'UTF-8'));

    send.getParameters().put('partner',EncodingUtil.urlEncode(partner==null?'':partner,'UTF-8'));

    send.getParameters().put('activityid',EncodingUtil.urlEncode(activityid==null?'':activityid,'UTF-8'));

    send.getParameters().put('customerid',EncodingUtil.urlEncode(customerid==null?'':customerid,'UTF-8'));

    send.getParameters().put('lzsite',EncodingUtil.urlEncode(lzsite==null?'':lzsite,'UTF-8'));

    send.getParameters().put('SNEID',EncodingUtil.urlEncode(SNEID==null?'':SNEID,'UTF-8'));

        send.setRedirect(true);

        

        return send;

}

}

 

The test class :

 

@isTest

private class MinisiteFlow_Controller_Test {

statictestMethodvoid myUnitTest(){

    PageReference pageRef = Page.MinisiteFlow;

    Test.setCurrentPage(pageRef);

Lead l = new Lead(Company = 'test1@test.com', FirstName = 'first1', LastName = 'last1');

    insert l;

   Id lid = l.Id;

    ApexPages.currentPage().getParameters().put('rurl','/'+l.Id);

        MinisiteFlow_Controller controller = new MinisiteFlow_Controller();

        controller.getEndPage();

}

  • June 26, 2012
  • Like
  • 0

I have controller to access variable from flow when I create test class code coverage is to low because the can not access variable from flow in test class.Can help me to improve this test class.

The controller:

 

public with sharing class MinisiteFlow_Controller {

public String returnURL = ApexPages.currentPage().getParameters().get('rurl');

public Flow.Interview.MinisitePart1_1 MiniSiteFlow{get;set;}

public String lzsite{get;set;}

public String firstname{get;set;}

public String lastname{get;set;}

public String email{get;set;}

public String phone{get;set;}

public String state{get;set;}

public String partner{get;set;}

public String activityid{get;set;}

public String customerid{get;set;}

public Id SNEID{get;set;}

public PageReference getEndPage() {

PageReference send = new PageReference('/apex/MinisiteFlow_LastStep');

if(MiniSiteFlow != null){ 

    SNEID = MiniSiteFlow.SNEID;

  lzsite  = MiniSiteFlow.vEndPage;

firstname = MiniSiteFlow.vFirstName;   

lastname  = MiniSiteFlow.vLastName; 

    email  = MiniSiteFlow.vLeadEmail;   

    phone  = MiniSiteFlow.vPhone;

  state  = MiniSiteFlow.vState;

  partner  = MiniSiteFlow.vPartner;

  activityid  = MiniSiteFlow.vActivityId;

  customerid  = MiniSiteFlow.vCustomerID; 

    send.getParameters().put('rurl',EncodingUtil.urlEncode(returnURL==null?'':returnURL,'UTF-8'));

    send.getParameters().put('firstname',EncodingUtil.urlEncode(firstname==null?'':firstname,'UTF-8'));

    send.getParameters().put('lastname',EncodingUtil.urlEncode(lastname==null?'':lastname,'UTF-8'));

    send.getParameters().put('email',EncodingUtil.urlEncode(email==null?'':email,'UTF-8'));

    send.getParameters().put('phone',EncodingUtil.urlEncode(phone==null?'':phone,'UTF-8'));

    send.getParameters().put('state',EncodingUtil.urlEncode(state==null?'':state,'UTF-8'));

    send.getParameters().put('partner',EncodingUtil.urlEncode(partner==null?'':partner,'UTF-8'));

    send.getParameters().put('activityid',EncodingUtil.urlEncode(activityid==null?'':activityid,'UTF-8'));

    send.getParameters().put('customerid',EncodingUtil.urlEncode(customerid==null?'':customerid,'UTF-8'));

    send.getParameters().put('lzsite',EncodingUtil.urlEncode(lzsite==null?'':lzsite,'UTF-8'));

    send.getParameters().put('SNEID',EncodingUtil.urlEncode(SNEID==null?'':SNEID,'UTF-8'));

        send.setRedirect(true);

        

        return send;

}

}

 

The test class :

 

@isTest

private class MinisiteFlow_Controller_Test {

statictestMethodvoid myUnitTest(){

    PageReference pageRef = Page.MinisiteFlow;

    Test.setCurrentPage(pageRef);

Lead l = new Lead(Company = 'test1@test.com', FirstName = 'first1', LastName = 'last1');

    insert l;

   Id lid = l.Id;

    ApexPages.currentPage().getParameters().put('rurl','/'+l.Id);

        MinisiteFlow_Controller controller = new MinisiteFlow_Controller();

        controller.getEndPage();

}

  • June 26, 2012
  • Like
  • 0

We have created a flow that creates an Opportunity and we want the "finishlocation" of the flow, where they end up when they click "Finish", to be the newly created Opportunity. I know that we will have to create a VF page and controller to pass the OpptyID (once created) back to the VF page and set as the finishlocation, but can't figure out how to do it. Any ideas?

I'm designing some flows for which I'd like the finishLocation behavior to change depending on the path of the flow.  Depending what happens in the flow, I need users to end up at different pages when the flow is over.  Is there a way to do that without writing custom code?

  • February 13, 2012
  • Like
  • 0

I have a curious case where I have a Visual Flow embedded in a Visualforce Page. This works fine.

 

I have a few variables in the Flow which are exposed to the Visualforce Page (For example, contact Name, Phone, and Email) which I want to display during the entire Flow process.This works fine except one problem:

 

The variables aren't displayed when they are set in the Flow. I have to go to an additional screen by clicking Next or Previous to get the values back in the Visualforce Page when they have already been set in the Flow.

 

Anyone seen this similar type behavior? It's probably something super simple but I just don't see it at the moment.

Hey all,

 

Taking my first plunge into VisualFlow. I've bashed together a lil proof of concept and it's all working fine bar one thing.

 

What I'd like is that when the flow finishes, the user is taken to another VisualForce page. This Visualforce page is passed a parameter that has the value of a variable in the flow. This is how I'm currently trying to do it:

 

In the VF page:

<flow:interview name="Test_1" interview="{!myflow}" finishLocation="{!EndPage}"/>

 

In the controller for this page:

    public PageReference getEndPage() {
        PageReference pageRef = Page.EndOrder;
         String oid =myflow.vOrder;
         pageRef.getParameters().put('order', oid);   
            return pageRef;
    }

 

where vOrder is a variable set in the flow.

 

But when I try and load the VF page I get the following error:

System.FlowException: Interview not started

 

How can I get the variable value that I can pass as a parameter to the follow page?

 

Thanks