• Karanbir Singh
  • NEWBIE
  • 30 Points
  • Member since 2015


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies

In the 'Task' Object i have a multi select picklist with names of users in my Lightning org. 

I want the user to be notified or atleast get linked to a particular task when his names is selected from the multiselect picklist.

Any suggestions how to go about it?

I have created 2 block in my VF page. one for taking input and the other for displaying list of accounts.

I want edit and delete functionality for each Account record in the list.

I've successfully created everything except the delete functionality of the delete button. The controller and Markup code are below:

Controller: 

public class AccountCustom {
  public List<account> accountlist = new List<account>();
    public Account account{get; set;}
    
    ApexPages.StandardSetController ssc;
    
   public List<account> accdelete = new List<account>();
    public String accid{get; set;}
        
    
        //Constructor
        public AccountCustom()
        {
             accountQuerry();
        
        }
        
        //Method with the querry for the list
        public void accountQuerry()
        {
            
            accountlist = [SELECT Id, Name, Phone FROM Account];
            ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(accountlist);
        }
        
    
    
        //get Method being called from VF page to display list
        public List<account> getAccountList()
        {
            return accountlist;
        }
    
    
        //Save Method
        public void save()
        {
            account = new Account();
            insert account;
            accountQuerry();
        }

        //Method for deleting accounts from the list
        public void deleteAccount()
        {
            
            accdelete = [SELECT Id, Name, Phone FROM Account WHERE Id = :accid];
            
            if(accdelete.size() > 0)
            {
               if(accdelete[0].Id != '')
               {
                delete accdelete;
               }
            }
            accountQuerry();
        }
        
    
    
}





VF Page:


<apex:page controller="AccountCustom">
    <apex:form >
        <apex:pageBlock title="Create/Update Account">                                
            
            <apex:pageBlockSection > 
                
                <apex:inputField value="{!account.Name}"/>                                
                <apex:inputField value="{!account.Phone}"/>                            
                
            </apex:pageBlockSection>
            <apex:commandButton action="{!save}" value="Save" />                    
            
        </apex:pageBlock>

        <apex:pageBlock title="List Of Accounts">                                    
            
            <apex:pageBlockTable value="{!AccountList}" var="ac">                    
                
                <apex:column width="40">
                    <apex:outputLink value="/{!ac.id}/e?retURL=%2F{!ac.id}">
                    Edit
                    </apex:outputLink>
                
                </apex:column>
                <apex:column value="{!ac.Name}"/>
                <apex:column value="{!ac.Phone}"/>
                <apex:column value="{!ac.id}"/>
                <apex:column >
                    <apex:commandButton action="{!deleteAccount}" value="Delete" immediate="true">            
                   
                        <apex:param value="{!ac.id}" assignTo="{!accid}"/>
                    </apex:commandButton>                                                
                                   
                </apex:column>
                
            </apex:pageBlockTable>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>

I'm new to visualforce and i know a way of creating a popup using javascript. Is there anyother way to create a popup which doesn't involve javascript?

I want my code to be a purely visualforce code 

I have created 2 block in my VF page. one for taking input and the other for displaying list of accounts.

I want edit and delete functionality for each Account record in the list.

I've successfully created everything except the delete functionality of the delete button. The controller and Markup code are below:

Controller: 

public class AccountCustom {
  public List<account> accountlist = new List<account>();
    public Account account{get; set;}
    
    ApexPages.StandardSetController ssc;
    
   public List<account> accdelete = new List<account>();
    public String accid{get; set;}
        
    
        //Constructor
        public AccountCustom()
        {
             accountQuerry();
        
        }
        
        //Method with the querry for the list
        public void accountQuerry()
        {
            
            accountlist = [SELECT Id, Name, Phone FROM Account];
            ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(accountlist);
        }
        
    
    
        //get Method being called from VF page to display list
        public List<account> getAccountList()
        {
            return accountlist;
        }
    
    
        //Save Method
        public void save()
        {
            account = new Account();
            insert account;
            accountQuerry();
        }

        //Method for deleting accounts from the list
        public void deleteAccount()
        {
            
            accdelete = [SELECT Id, Name, Phone FROM Account WHERE Id = :accid];
            
            if(accdelete.size() > 0)
            {
               if(accdelete[0].Id != '')
               {
                delete accdelete;
               }
            }
            accountQuerry();
        }
        
    
    
}





VF Page:


<apex:page controller="AccountCustom">
    <apex:form >
        <apex:pageBlock title="Create/Update Account">                                
            
            <apex:pageBlockSection > 
                
                <apex:inputField value="{!account.Name}"/>                                
                <apex:inputField value="{!account.Phone}"/>                            
                
            </apex:pageBlockSection>
            <apex:commandButton action="{!save}" value="Save" />                    
            
        </apex:pageBlock>

        <apex:pageBlock title="List Of Accounts">                                    
            
            <apex:pageBlockTable value="{!AccountList}" var="ac">                    
                
                <apex:column width="40">
                    <apex:outputLink value="/{!ac.id}/e?retURL=%2F{!ac.id}">
                    Edit
                    </apex:outputLink>
                
                </apex:column>
                <apex:column value="{!ac.Name}"/>
                <apex:column value="{!ac.Phone}"/>
                <apex:column value="{!ac.id}"/>
                <apex:column >
                    <apex:commandButton action="{!deleteAccount}" value="Delete" immediate="true">            
                   
                        <apex:param value="{!ac.id}" assignTo="{!accid}"/>
                    </apex:commandButton>                                                
                                   
                </apex:column>
                
            </apex:pageBlockTable>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>

I'm new to visualforce and i know a way of creating a popup using javascript. Is there anyother way to create a popup which doesn't involve javascript?

I want my code to be a purely visualforce code