I am attempting to extend the functions of our products and show a list on the account page where we can denote what products, services, or reccomendations we've given our clients.
To do this I was creating a visualforce page that would appear to be a related list to our employees with some extended functionality.
The issue is with one of these pieces of extended functionality.
When the employee changes the "Check Back on Date" a pop-up will open asking if they would like to set up a reminder task for the product.
The issue right now is that it's not passing the name of the product.
Visualforce:
<apex:page showHeader="false" sidebar="false" standardController="Account" extensions="AccountProductExtension" action="{!ActionAccountProductRun}">
<apex:form >
<apex:pageBlock title="Associated Products and Services">
<apex:pageBlockButtons location="Top">
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!accountProducts}" var="p">
<apex:column headerValue="Product or Service" value="{!p.name}"/>
<apex:column title="Type" value="{!p.Type__c}"/>
<apex:column headerValue="Status">
<apex:inputField value="{!p.Status__c}"/>
</apex:column>
<apex:column headerValue="Date Offered">
<apex:inputField value="{!p.DateOffered__c}"/>
</apex:column>
<apex:column headerValue="Check Back On">
<apex:inputField value="{!p.CheckBackDate__c}">
<apex:actionSupport event="onchange" onsubmit="Confirm();" reRender="out">
<apex:param name="cDate" value="{!p.CheckBackDate__c}" assignTo="{!checkBackDate}"/>
<apex:param name="cName" value="{!p.Name}" assignTo="{!productName}"/>
</apex:actionSupport>
</apex:inputField>
</apex:column>
<apex:column headerValue="Notes">
<apex:inputField value="{!p.Notes__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<script>
window.setTimeout(recursivecall,500);
function recursivecall()
{
window.setTimeout(recursivecall,500);
autosave();
}
function Confirm() {
if ( confirm("Would you like to set a reminder to check back with the TA of {!Account.Name}?")){
sendTask();
}
}
</script>
<apex:actionFunction name="sendTask" action="{!sendTask}" reRender="out"/>
<apex:actionFunction name="autosave" action="{!autosave}" reRender="out"/>
</apex:form>
<script>
setFocus = function() { return; }
</script>
</apex:page>
I couldn't find anything that said setting two param's shouldn't work.
Why will the "p.Name" field not pass into the code?
params
at all. Try removing the params and see if that resolves it. When your action function is called it should send the form data to the controller. Your params are overwriting the values to null as the merge fields are null when the params component is rendered and you are not passing anything to them