• Julianne0223
  • NEWBIE
  • 5 Points
  • Member since 2013


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

I have a flow that has a date input field.  I'm calling the flow in a Visualforce page that has a CSS applied.  Because I'm not using standard stylesheets, the date picker format is not available.  Typically I would use java script to mimic the date picker behavior, but I'm not sure ther eis a way to do this in the CSS related to a flowDate.  Has anyone else done this before?

I am not an advance developer by any definition, and I have been trying to figure this out pouring over other blogs and forums for days now.  I finally give up and am hoping someone can help me.

I have a flow that I am calling and passing variables to via a custom button (Visualforce Page) on the Account detail page.  The page setting the flow finish page and redirecting the user to the record created by the flow by using a controller extension.  

Everything is working as it should, but I won't be able to move any of this to production until I can figure out a way to get test coverage of the controller extension.

This is the class:
public class takeMetoContractController {
public takeMetoContractController(ApexPages.StandardController controller) {
}

public Flow.Interview.Buan_Test rFlow {get; set;} 
   

    public String getcontractID() {

        if (rFlow==null) return '';

        else return rFlow.varMcContractID;

    }


    public PageReference getFinishPage(){

        PageReference p = new PageReference('/' + getcontractID() );

        p.setRedirect(true);

        return p;
    }
}


It is being used in this page:
<apex:page sidebar="false"  standardController="Account" extensions="takeMetoContractController">

<flow:interview name="Buan_Test" interview="{!rFlow}" finishLocation="{!FinishPage}">
<apex:param name="Accountsfid" value="{!account.Id}"/>
<apex:param name="AccountSFName" value="{!account.Name}"/>
</flow:interview>
</apex:page>

 
I've got no idea how to get this test class to actually call the controller extension appropriately, but I have managed to get a test class to save.  Here is what I have (no making fun, please):

@isTest
public class testtakeMetoContractController {

public static void testtakeMetoContractController() {

    //Insert Account
    Account acct = new Account(Name='TestClassAccount');
    insert acct;
   
    // Retrieve the new Account
    acct = [SELECT Id,Name FROM Account WHERE Id =:acct.Id];
   
    //Insert Contact
    Contact c = new Contact (Account=acct, FirstName='Test', LastName='Contact');
    insert c;
   
    //Insert McContract
    McContracts__c mc = new McContracts__c (Account_Name__c=acct.Id, Contact__c=c.Id);
    insert mc;
   
    //Retrieve the new Contract
    mc = [Select Id, Name FROM McContracts__c WHERE Id =:mc.Id];
   
    String mcID = mc.Id;
    System.debug(mcID);

    ApexPages.StandardController sc = new ApexPages.StandardController(acct);
    takeMetoContractController ec = new takeMetoContractController(sc);
   
    PageReference FlowContractPageRef = Page.FlowContract;
    Test.setCurrentPage(FlowContractPageRef);

    string vaMcContractId=mcId;
    ec.getFinishPage();
    ec.getContractId();
   
    System.test.startTest();
    System.debug('ContractId - Add ContractId');
    System.debug('ContractId - Save');
    System.test.stopTest();
     
}
}


It is clearly a mess, and I really have no idea what I am doing, so if anyone has a solution to this or feels like being a good samaritan and wants to help, it would be greatly appreciated.

I have a flow that has a date input field.  I'm calling the flow in a Visualforce page that has a CSS applied.  Because I'm not using standard stylesheets, the date picker format is not available.  Typically I would use java script to mimic the date picker behavior, but I'm not sure ther eis a way to do this in the CSS related to a flowDate.  Has anyone else done this before?