+ Start a Discussion
ErrorProneErrorProne 

Query string VisualForce for Professional Edition

<apex:page standardController="task">
<apex:form >
<apex:pageBlock title="Log A Call or Meeting" mode="edit" >
<apex:pageBlockSection columns="2" title="Call Information">
<apex:inputField value="{!Task.OwnerId}" rendered="true"/>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:inputField value="{!Task.Subject}" rendered="true"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 Nothing Crazy here. I just need to find a way to pass values into the fields. Normally I would use a Quesry String URL but that won't work on visualforce pages. Anyone have a clever way to do this that doesn't involve creating an apex class. Professional Edition Does not include custom apex classes or extensionts.

 

Any help would be awesome

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

You may have to use javascript.  However, you could try the following component of mine:

 

<apex:component >
    <apex:attribute name="from" type="String" assignTo="{!to}" description="The value to set"/>
    <apex:attribute name="to" type="String" description="The variable to set the value into"/>    
</apex:component>

 

and then use that on the page:

 

<c:SetValue from="{!$CurrentPage.parameters.subject}" to="{!Task.subject}" />

 Caveat emptor - I haven't tried this myself so it may not work. 

All Answers

bob_buzzardbob_buzzard

You should be able to access URL parameters in visualforce via the $ApexPages global - e.g. to access the id parameter you'd use:

 

{!$CurrentPage.parameters.id}

 

You'll probably need to use javascript to set the value into the input component.

ErrorProneErrorProne

Didn't mean to hit solved. meant to hit reply

 

I've tried this, but I can't get it to autofill the input fields. How would I use this to have: "Test:" preentered into the subject input field?

 

/apex/vforcepage?subject=test

 

 

bob_buzzardbob_buzzard

You may have to use javascript.  However, you could try the following component of mine:

 

<apex:component >
    <apex:attribute name="from" type="String" assignTo="{!to}" description="The value to set"/>
    <apex:attribute name="to" type="String" description="The variable to set the value into"/>    
</apex:component>

 

and then use that on the page:

 

<c:SetValue from="{!$CurrentPage.parameters.subject}" to="{!Task.subject}" />

 Caveat emptor - I haven't tried this myself so it may not work. 

This was selected as the best answer
ErrorProneErrorProne

Bob, you are the man. now if only you could give me the last 12 hours of my life back!

 

Works great thanks for the quick response