Thursday, June 21, 2018

Closing window in Visualforce

Using JavaScript:

<apex:page showChat="false" wizard="true" sidebar="false" >
<!-- Javascript -->
<script type = "text/javascript">
    function winClose()
    {
        self.close();
    }
</script>
<!-- End of Javascript-->

<apex:commandButton onComplete = "winClose();">

</apex:page>

Using Apex PageReference :

public PageReference method(){
        if(variable== null || variable == ''){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please enter variable'));
            return null;

        }else{
return new PageReference('javascript:window.close()');
}

Wednesday, June 13, 2018

Difference between deactivate and freeze user in salesforce

In some cases, you can’t immediately deactivate a user such as when a user is selected in a custom hierarchy field or a user that’s assigned as the sole recipient of a workflow email alert. To prevent users from logging into your organization while you perform the steps to deactivate them you can freeze users.
  • Freezing user doesn’t make their user licenses available for use in your organization.
  • Deactivating a user will be available user licenses available for use in your organization.