Tuesday, 12 April 2016

Flow EXample

public class PluginExample  implements Process.plugin{
    public Process.PluginResult invoke(Process.PluginRequest request){
        String name=(string)request.inputParameters.get('empName');
        name='My Name '+name;
        Map<String,Object> objMap=new Map<String,Object>();
        objMap.put('finalName',name);
        Process.PluginResult result=new Process.PluginResult(objMap);
        return result;
    }
    public Process.PluginDescribeResult describe(){
        Process.PluginDescribeResult result=new Process.PluginDescribeResult();
        result.inputParameters=new List<Process.PluginDescribeResult.inputParameter>{
            new Process.PluginDescribeResult.inputParameter('empName',Process.PluginDescribeResult.parameterType.String,true)
        };
        result.outputParameters=new List<Process.PluginDescribeResult.outputParameter>{
            new Process.PluginDescribeResult.outputParameter('finalName',Process.PluginDescribeResult.parameterType.String)
        };
        return result;
    }

}


VF page :
<apex:page >
    <flow:interview name="flow2" finishLocation="/apex/page1"> </flow:interview>
</apex:page>



==================================================================
StandardSetController:
public class ListButton {
    public List<Account> accs {set;get;}
    public ListButton(ApexPages.StandardSetController controller){
        List<String> fields=new List<String>{'Name','Industry','phone'};
        controller.addFields(fields);
        accs=(List<Account>)controller.getSelected();
    }
    public void getData(){
        delete accs;
    }
}
<apex:page  standardController="Account" extensions="ListButton" action="{!getData}" recordSetVar="items">
    <apex:pageBlock title="Accounts">
                <apex:pageBlockTable value="{!accs}" var="a">
            <apex:column value="{!a.name}" />
            <apex:column value="{!a.industry}" />
        </apex:pageBlockTable>
    </apex:pageBlock>

</apex:page>

No comments:

Post a Comment