+ Start a Discussion
AthiSachiAthiSachi 

Custom button on List view returns because it hasn't been set or assigned

Client want mass change on button click. There are some condition to check on selected records.
Example: If user select 100 records and click button,  it has to check if email is not null  and one more. Both are rollup fields. If any of that 2 fields empty, I want to let the user know and use appropriate view. Because in SF button is available in all list view.If i can make button visible to specific list view, my problem solved. unfortunately thats not that option right now. I need to restrict the user from using other view.
 I used andrew logic in below link and works perfectly .
https://andyinthecloud.com/2015/12/12/visual-flow-with-list-view-and-related-list-buttons/

Here comes the problem, flow couldnt take null value and throwing error. I tried to set the value to "not set"  in visualforce page, but i dont seem working. I tried debug log but in vien.


<apex:page standardController="Contact" tabStyle="Contact" recordSetVar="AllC" >
<!-- Add below each field you reference in your Flow -->
<apex:repeat value="{!AllC}" var="row"  rendered="TRUE">
{!row.Id}
{!IF(ISBLANK(row.Parent_Email__c), 'Not Set',row.Parent_Email__c) } </apex:repeat>
<!-- Runs your Flow -->
<flow:interview name="EmailToContacts" finishLocation="{!$CurrentPage.parameters.retURL}">
 <apex:param name="CVarCon" value="{!Selected}"/> </flow:interview> </apex:page>

This line not working 
{!IF(ISBLANK(row.Parent_Email__c), 'Not Set',row.Parent_Email__c) }

My expectation is: email set to "Not Set" so flow wont throw error and i can also check condition for "Not Set" and warn user to use appropriate view. OR I would like to throw error in visual page itself, that would be perfect.
I am stuck here. Please help.
 
Best Answer chosen by AthiSachi
AthiSachiAthiSachi
If anyone want to know in future.
Parent_Email__c null values are updated with '.' instead of blank. Now I can bypass the error. Works Great.
Thanks