• NKrishna
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 8
    Replies
Hi All,

I have a custom lightning component, it has lightning tabs which are tab1,tab2.
I have a button on Tab1. If I click the button tab2 will open automatically.

Is it possible?

Please help me.

Hi,

 

I am using salesforce with java integration project.

 

Here I am accessing the data's from the SQL database to salesforce using the webservices and vice versa.

 

In that I am using JSON format webservices.

 

Here is the code.,

 

 

public class updateAccount {
    public void UpdateExternalAccount() {
        AccountClass AccountClassObj = new AccountClass();
        AccountClassObj.CreateUserID = 'Krishnan';
        AccountClassObj.Industry = Entitlement_Values;
        AccountClassObj.UserCode = Rep;
        AccountClassObj.UserRole = UserRole;
        AccountClassObj.AccountID = AccountID;
        
        string serializedOutput = JSON.serializePretty(AccountClassObj);
        system.debug('system.debug '+ serializedOutput);
        String jsonoutput;  
            
        HttpRequest req = new HttpRequest();
        HttpResponse res = new HttpResponse();
        Http http = new Http();
        String url='http://webservice.url.com/sf/ws/Functionname';
        req.setMethod('POST');          
        req.setHeader('content-type', 'application/json');
        req.setHeader('Accept', 'application/json');
        req.setEndpoint(url);
        system.debug('serializedOutput ' + serializedOutput);   
        req.setBody(serializedOutput);
        //req.setBody('{\"createUserID\":\"Kris\",\"AccountID\":\"123456789\",\"Industry\":\"Energy, Finance\",\"UserCode\":\"abc\",\"UserRole\":\"RW\"}');

        system.debug('req ' + req);
        res = http.send(req);
        System.debug(res.toString());
        System.debug(http.toString());                          
        //jsonoutput = res.getBody();
        if(res.getStatusCode() == 200) {
            jsonoutput = res.getBody();  
        } else {
            system.debug('Could not contact web service');
            jsonoutput = 'Exception : Could not contact web service';
        }
        system.debug('res ' + res);
        system.debug('jsonoutput '+ jsonoutput);

    }
    
    public class AccountClass {     
        public string Industry;   
        public string AccountID;
        public string UserCode;
        public string UserRole;
        public string CreateUserID;               
    }

}

 

If i am calling the above class the DB is not updated, but I am changing the code like this.,(passing the values via hard coded)

 

                req.setEndpoint(url); 
		//system.debug('serializedOutput ' + serializedOutput);   
		//req.setBody(serializedOutput);
		req.setBody('{\"createUserID\":\"Kris\",\"AccountID\":\"123456789\",\"Industry\":\"Energy, Finance\",\"UserCode\":\"abc\",\"UserRole\":\"RW\"}');

		system.debug('req ' + req);

 Now the values are updated in DB.,

 

So the values are not updated because of JSON.serializePretty functions,

 

string serializedOutput = JSON.serializePretty(AccountClassObj);

 

How to resolve the above issue?

Hi,

 

I am using wrapper class to fetch the consumer object values and passed into Data table,

 

In that I am using consumer code and consumer name are the two text boxes.

 

Once I am enter the Consumer code,  I need to make a Webservice call via javascript(not in apex code) and fetch the customer name from external webservice.

 

How to do that?

 

Plese share the sample code also if possible.

 

Thanks,
Krishna.

Hi,

 

I am using external web service to fetch the users data in salesforce. In that, I can use the userId values to JSON serialization and pass the value to external webservice and I get the USerdata in a JSON fomat.

 

{"PrimaryUserInfo":{"createdTimestamp":"2012-12-05 00:00:00.0","updateTimestamp":"2012-12-05 00:00:00.0","userFirstName":"nkm","userMiddleName":"","userLastName":"Krishna","userStatus":"ACTIVE"},"additionalUserCode":[{"UserCode":"K7","name":"NKMT MADDY","title":""}, {"UserCode":"E3","name":"HOLE","title":""}], "associatedUserCode":[{"UserCode":"M7","name":"QWERT MADDY","title":""}, {"UserCode":"V3","name":"HOLEY KILLI","title":""}],"managedUserCode":[{"UserCode":"A1","name":"ADAM GIL","title":""},{"UserCode":"B4","name":"ADAM MORE","title":""},{"UserCode":"C4","name":"ADRO BATISTA","title":""},{"UserCode":"H4","name":"ALIS MICHAEL","title":""},{"UserCode":"V7","name":"ALKS LIDES","title":""},{"UserCode":"T3","name":"HOLEWA","title":""}]}

 Once I am using deserializing I can't fetch to objects, I can fetch only strings.

 

Here is my Salesforce classes.,

public class PrimaryUserInfo {    
    public String createdTimestamp;
    public String updateTimestamp;
    public String userFirstName;
    public String userMiddleName;
    public String userLastName;
    public String userStatus;
}  
public class AddUserInfo {
        
    public String RepCode;
    public String RepName;
    public String title;        
}
public class ViewUser{		
	public PrimaryUser 			PrimaryUserInfo;		
	public List<AddUserInfo>	additionalUserCode;
	public List<AddUserInfo>	associatedUserCode;
	public List<AddUserInfo>	managedUserCode;						
}

 So How to deserize into the JSON values to apex class objects like I need ViewUser Apex class objects??

 

Here is the code for deserilzing the JSON.,

System.JSONParser parser = JSON.createParser(aaa);
parser.nextToken(); // START OBJECT
parser.nextToken(); // name
parser.nextToken(); // primaryRep value
PrimaryUserInfo primaryUsers = (PrimaryUserInfo)parser.readValueAs(PrimaryUserInfo.class); 
system.debug('primaryUsers '+ primaryUsers);
parser.nextToken();

while (parser.nextToken() != JSONToken.END_OBJECT) {
	if (parser.getCurrentToken() == JSONToken.FIELD_NAME) {
		String text = parser.getText();
		parser.nextToken();
		RepCodeWrapper RepCodeRow = new RepCodeWrapper();
		if(text == 'managedUserCode') {
		} else if(text == 'Name') {
			RepCodeRow.RepName = parser.getText();
		} else if(text == 'UserCode') {
			RepCodeRow.RepCode = parser.getText();
		} else {
			System.debug(LoggingLevel.WARN, 'JsonClassifier consuming unrecognized property: '+text);
			//consumeObject(parser);
		}
	}
}

 

In that I can get PrimaryUserInfo Object. But I need to get AdditionalUserInfo, AssociatedUSerInfo and ManagedUserInfo Object values.

 

Please help me.

 

Thanks,

Krishna.

I am new to Joined reports and I read the summer 12 release notes for joined reports. In that they mentioned they select 3 blocks in the same report type. But Once I tried in my developer org, I can't select the same report type in other blocks. Am I missing? Thanks, Krishna.

Hi,

How to use date field in SOQL query?

Here is my code:

 

string OpportunityQuery;
OpportunityQuery = 'SELECT Name, Id FROM Opportunity WHERE ';
OpportunityQuery += 'OwnerId = \''+ FromUser + '\'';
OpportunityQuery += ' AND ';

OpportunityQuery +=  'AccountId = \''+ DealerId + '\'';
system.debug('Decision_Date__c ' + ObjOpportunity.Decision_Date__c);
system.debug('Application_Date__c ' + ObjOpportunity.Application_Date__c);

date FromDate = Date.newInstance(ObjOpportunity.Decision_Date__c.year(),ObjOpportunity.Decision_Date__c.month(),ObjOpportunity.Decision_Date__c.day());
date ToDate = Date.newInstance(ObjOpportunity.Application_Date__c.year(),ObjOpportunity.Application_Date__c.month(),ObjOpportunity.Application_Date__c.day());

if(Selection == 'BookDate') {
    OpportunityQuery += ' AND ';
    OpportunityQuery += 'CloseDate >= '+ FromDate;
    OpportunityQuery += ' AND ';
    OpportunityQuery += 'CloseDate <= '+ ToDate;     
}

if(AppType == 'Booked') {
    OpportunityQuery += ' AND ';
    OpportunityQuery += ' IsWon = true ';    
}
OpportunityList = database.query(OpportunityQuery);
system.debug('OpportunityList: '+ OpportunityList);

 

 

System debug:

SELECT Name, Id FROM Opportunity WHERE OwnerId = '00530000003Ks0yAAC' AND AccountId = '001Q000000QtH1BIAV' AND CloseDate >= 2012-03-02 00:00:00 AND CloseDate <= 2012-03-23 00:00:00

The above code shows the below error.

System.QueryException: line 1:144 no viable alternative at character ' '

Thanks,
Krishna.

I created a new apex trigger in Account object.

    The trigger checks the Account's OwnerId is Active or not.
    If active then It will go to before insert & after insert events as per the below trigger code.
    
    Once I check with active users ITs worked fine . but,
    
    I created a new csv file called Account.csv consists 250 Active User's records and 250 Inactive user's records.
    
    So Once I ran via data loader, I am getting 3 debug log files.
    
    The every debug logs shows the 2 time of before insert operation and 2 times of after insert operation.
    
    Why It happened?
    
    Anything I missed in the code?

trigger AccountTrigger on Account (before insert, before update, after insert, after update) {

    if(Trigger.IsInsert) {
        List<Account> AccountList = new List<Account>();
        Map<Id,List<Account>> AccountListMap = new Map<Id,List<Account>>();
        Map<Id, Boolean> UsersActiveMap = new Map<Id, Boolean>();
        
        for(Account AccountNew : Trigger.New) {
        	List<Account> ListAccount = AccountListMap.get(AccountNew.OwnerId);
        	if(ListAccount == null) {
        		ListAccount = new List<Account>();
        		AccountListMap.put(AccountNew.OwnerId, ListAccount);
        	}
        	ListAccount.add(AccountNew);
        }
        system.debug('AccountListMap Values '+ AccountListMap);
        system.debug('AccountListMap SIZE Values '+ AccountListMap.size());
        
        List<User> UserList = [SELECT Id, name, Username, IsActive FROM user WHERE Id IN : AccountListMap.Keyset()];
        for(User Users : UserList) {
            UsersActiveMap.put(Users.Id, Users.IsActive);
        }
        system.debug('UsersActiveMap Values '+ UsersActiveMap);
        
        for(Id OwnerId : AccountListMap.Keyset()) {
        	if(UsersActiveMap.get(OwnerId)) {
        		AccountList.addall(AccountListMap.get(OwnerId));
            	system.debug('AccountList' + AccountList.size());	
            } 
                
        }
        system.debug('AccountList Values '+ AccountList);
        
        if(Trigger.IsBefore) {
        	system.debug('SSS AccountList Size() BEFORE INSERT ' + AccountList.size());
        	AccountTriggerClass.UpdateCallFrequency(AccountList);
        }

        if(Trigger.IsAfter) {
        	system.debug('SSS AccountList Size() AFTER INSERT ' + AccountList.size());
            AccountTriggerClass.CreateTaskOnAccount(AccountList, false);            
        }
    }

    if(Trigger.IsUpdate) {
    
       if(Trigger.IsBefore) {
            Map<Id, Account> AccountMapNew = new Map<Id, Account>();
            Map<Id, string> AccountMapOld = new Map<Id, string>();
            
            //List<Account> AccountList = new List<Account>();
	        Map<Id,List<Account>> AccountListMap = new Map<Id,List<Account>>();
	        Map<Id, Boolean> UsersActiveMap = new Map<Id, Boolean>();
	        
	        for(Account AccountNew : Trigger.New) {
	        	List<Account> ListAccount = AccountListMap.get(AccountNew.OwnerId);
	        	if(ListAccount == null) {
	        		ListAccount = new List<Account>();
	        		AccountListMap.put(AccountNew.OwnerId, ListAccount);
	        	}
	        	ListAccount.add(AccountNew);
	        }
	        system.debug('AccountListMap Values '+ AccountListMap);
        	system.debug('AccountListMap SIZE Values '+ AccountListMap.size());
        
        	List<User> UserList = [SELECT Id, name, Username, IsActive FROM user WHERE Id IN : AccountListMap.Keyset()];
	        for(User Users : UserList) {
	            UsersActiveMap.put(Users.Id, Users.IsActive);
	        }
	        system.debug('UsersActiveMap Values '+ UsersActiveMap);
        
	        for(Id OwnerId : AccountListMap.Keyset()) {
	        	if(UsersActiveMap.get(OwnerId)) {
	        		List<Account> AccList = new List<Account>();
	        		AccList = AccountListMap.get(OwnerId);
	        		for(Account Acc : AccList) {
	        			AccountMapNew.put(Acc.Id, Acc);
	        		}
	            } 
	        }
        	system.debug('AccountMapNew Values '+ AccountMapNew);
        
            for(Account AccountOld : Trigger.Old) {
                AccountMapOld.put(AccountOld.id, AccountOld.Name);
            }
			system.debug('AccountMapOld Values '+ AccountMapOld);
			
            AccountTriggerClass.UpdateAccount(AccountMapNew, AccountMapOld);
       }
         
       if(Trigger.IsAfter) {
            List<Account> AccountsMarkedDeleted = new List<Account>();
            Map<Id, Account> OldAccountMap = new Map<Id, Account>();
            Map<Id, Account> NewAccountMap = new Map<Id, Account>();            
            
            //List<Account> AccountList = new List<Account>();
	        Map<Id,List<Account>> AccountListMap = new Map<Id,List<Account>>();
	        Map<Id, Boolean> UsersActiveMap = new Map<Id, Boolean>();
	        
	        for(Account AccountNew : Trigger.New) {
	        	List<Account> ListAccount = AccountListMap.get(AccountNew.OwnerId);
	        	if(ListAccount == null) {
	        		ListAccount = new List<Account>();
	        		AccountListMap.put(AccountNew.OwnerId, ListAccount);
	        	}
	        	ListAccount.add(AccountNew);
	        }
	        system.debug('AccountListMap Values '+ AccountListMap);
        	system.debug('AccountListMap SIZE Values '+ AccountListMap.size());
        
        	List<User> UserList = [SELECT Id, name, Username, IsActive FROM user WHERE Id IN : AccountListMap.Keyset()];
	        for(User Users : UserList) {
	            UsersActiveMap.put(Users.Id, Users.IsActive);
	        }
	        system.debug('UsersActiveMap Values '+ UsersActiveMap);
        	
        	for(Account AccountOld : Trigger.Old) {
                OldAccountMap.put(AccountOld.Id, AccountOld);
            }
            system.debug('OldAccountMap Values '+ OldAccountMap);
            
            for(Id OwnerId : AccountListMap.Keyset()) {
	        	if(UsersActiveMap.get(OwnerId)) {
	        		List<Account> AccList = new List<Account>();
	        		AccList = AccountListMap.get(OwnerId);
	        		for(Account Acc : AccList) {
	        			//AccountMapNew.put(Acc.Id, Acc);
	        			if(!Acc.Active_Dealer__c)
                    		AccountsMarkedDeleted.add(Acc); 
                		else {
                    		//if(UsersActiveMap.get(AccountNew.OwnerId))
                        	NewAccountMap.put(Acc.Id, Acc);                                                       
                		}
	        		}
	            } 
	        }
        	system.debug('AccountsMarkedDeleted Values '+ AccountsMarkedDeleted);
        	system.debug('NewAccountMap Values '+ NewAccountMap);
            
            AccountTriggerClass.UpdateContactForActiveDealers(AccountsMarkedDeleted);
            AccountTriggerClass.UpdateTaskOnAccount(NewAccountMap, OldAccountMap);
       } 
    }
}

 

Hi,

I created a new Apex trigger in Account object.

 

trigger AccountTrigger on Account (before insert) {
    if(Trigger.IsInsert) {

        List<Account> AccountList = new List<Account>();
        Map<Id,Account> AccountMap = new Map<Id, Account>();
        Map<Id, Boolean> UsersActiveMap = new Map<Id, Boolean>();
        
        for(Account AccountNew : Trigger.New) {
            AccountMap.put(AccountNew.OwnerId, AccountNew);
        }
        system.debug('Account Map Values '+ AccountMap);
        system.debug('Account Map SIZE Values '+ AccountMap.size());
        
        List<User> UserList = [select Id, name, Username, IsActive from user where Id IN : AccountMap.Keyset()];
        for(User Users : UserList) {
            UsersActiveMap.put(Users.Id, Users.IsActive);
        }
        system.debug('UsersActiveMap Values '+ UsersActiveMap);
        
        for(Account Acc : AccountMap.Values()) {
            system.debug('AccountMap Size()' + AccountMap.size() + ' '+ Acc.OwnerId );
            if(UsersActiveMap.get(Acc.OwnerId)) {
                AccountList.add(Acc);
                system.debug('AccountList' + AccountList.size());    
            }
        }
        system.debug('AccountList Values '+ AccountList);
        if(Trigger.IsBefore) {
            system.debug('SSS AccountList Size()' + AccountList.size());
            AccountTriggerClass.UpdateCallFrequency(AccountList);
        }
    }    
}   

I run via data loader I have 20 records in CSV file.

I got only One record on line 12

system.debug('Account Map SIZE Values '+ AccountMap.size());

but I want 20.

Is anything I am missing..

 

 

 

Hi,

 

I created a new lead record via visual workflow and I binded that visual workflow into visualforce page.

 

Its working fine. But I need a latest created Lead record on visualforce page once I click the finish button on visual workflow.

 

I tried with finishlocation but its not working. Its just to move the home page only.

 

How to get that lead Id on visualforce page and redirect to the lead record?

 

 

Hi All,

I have a custom lightning component, it has lightning tabs which are tab1,tab2.
I have a button on Tab1. If I click the button tab2 will open automatically.

Is it possible?

Please help me.

I created a new apex trigger in Account object.

    The trigger checks the Account's OwnerId is Active or not.
    If active then It will go to before insert & after insert events as per the below trigger code.
    
    Once I check with active users ITs worked fine . but,
    
    I created a new csv file called Account.csv consists 250 Active User's records and 250 Inactive user's records.
    
    So Once I ran via data loader, I am getting 3 debug log files.
    
    The every debug logs shows the 2 time of before insert operation and 2 times of after insert operation.
    
    Why It happened?
    
    Anything I missed in the code?

trigger AccountTrigger on Account (before insert, before update, after insert, after update) {

    if(Trigger.IsInsert) {
        List<Account> AccountList = new List<Account>();
        Map<Id,List<Account>> AccountListMap = new Map<Id,List<Account>>();
        Map<Id, Boolean> UsersActiveMap = new Map<Id, Boolean>();
        
        for(Account AccountNew : Trigger.New) {
        	List<Account> ListAccount = AccountListMap.get(AccountNew.OwnerId);
        	if(ListAccount == null) {
        		ListAccount = new List<Account>();
        		AccountListMap.put(AccountNew.OwnerId, ListAccount);
        	}
        	ListAccount.add(AccountNew);
        }
        system.debug('AccountListMap Values '+ AccountListMap);
        system.debug('AccountListMap SIZE Values '+ AccountListMap.size());
        
        List<User> UserList = [SELECT Id, name, Username, IsActive FROM user WHERE Id IN : AccountListMap.Keyset()];
        for(User Users : UserList) {
            UsersActiveMap.put(Users.Id, Users.IsActive);
        }
        system.debug('UsersActiveMap Values '+ UsersActiveMap);
        
        for(Id OwnerId : AccountListMap.Keyset()) {
        	if(UsersActiveMap.get(OwnerId)) {
        		AccountList.addall(AccountListMap.get(OwnerId));
            	system.debug('AccountList' + AccountList.size());	
            } 
                
        }
        system.debug('AccountList Values '+ AccountList);
        
        if(Trigger.IsBefore) {
        	system.debug('SSS AccountList Size() BEFORE INSERT ' + AccountList.size());
        	AccountTriggerClass.UpdateCallFrequency(AccountList);
        }

        if(Trigger.IsAfter) {
        	system.debug('SSS AccountList Size() AFTER INSERT ' + AccountList.size());
            AccountTriggerClass.CreateTaskOnAccount(AccountList, false);            
        }
    }

    if(Trigger.IsUpdate) {
    
       if(Trigger.IsBefore) {
            Map<Id, Account> AccountMapNew = new Map<Id, Account>();
            Map<Id, string> AccountMapOld = new Map<Id, string>();
            
            //List<Account> AccountList = new List<Account>();
	        Map<Id,List<Account>> AccountListMap = new Map<Id,List<Account>>();
	        Map<Id, Boolean> UsersActiveMap = new Map<Id, Boolean>();
	        
	        for(Account AccountNew : Trigger.New) {
	        	List<Account> ListAccount = AccountListMap.get(AccountNew.OwnerId);
	        	if(ListAccount == null) {
	        		ListAccount = new List<Account>();
	        		AccountListMap.put(AccountNew.OwnerId, ListAccount);
	        	}
	        	ListAccount.add(AccountNew);
	        }
	        system.debug('AccountListMap Values '+ AccountListMap);
        	system.debug('AccountListMap SIZE Values '+ AccountListMap.size());
        
        	List<User> UserList = [SELECT Id, name, Username, IsActive FROM user WHERE Id IN : AccountListMap.Keyset()];
	        for(User Users : UserList) {
	            UsersActiveMap.put(Users.Id, Users.IsActive);
	        }
	        system.debug('UsersActiveMap Values '+ UsersActiveMap);
        
	        for(Id OwnerId : AccountListMap.Keyset()) {
	        	if(UsersActiveMap.get(OwnerId)) {
	        		List<Account> AccList = new List<Account>();
	        		AccList = AccountListMap.get(OwnerId);
	        		for(Account Acc : AccList) {
	        			AccountMapNew.put(Acc.Id, Acc);
	        		}
	            } 
	        }
        	system.debug('AccountMapNew Values '+ AccountMapNew);
        
            for(Account AccountOld : Trigger.Old) {
                AccountMapOld.put(AccountOld.id, AccountOld.Name);
            }
			system.debug('AccountMapOld Values '+ AccountMapOld);
			
            AccountTriggerClass.UpdateAccount(AccountMapNew, AccountMapOld);
       }
         
       if(Trigger.IsAfter) {
            List<Account> AccountsMarkedDeleted = new List<Account>();
            Map<Id, Account> OldAccountMap = new Map<Id, Account>();
            Map<Id, Account> NewAccountMap = new Map<Id, Account>();            
            
            //List<Account> AccountList = new List<Account>();
	        Map<Id,List<Account>> AccountListMap = new Map<Id,List<Account>>();
	        Map<Id, Boolean> UsersActiveMap = new Map<Id, Boolean>();
	        
	        for(Account AccountNew : Trigger.New) {
	        	List<Account> ListAccount = AccountListMap.get(AccountNew.OwnerId);
	        	if(ListAccount == null) {
	        		ListAccount = new List<Account>();
	        		AccountListMap.put(AccountNew.OwnerId, ListAccount);
	        	}
	        	ListAccount.add(AccountNew);
	        }
	        system.debug('AccountListMap Values '+ AccountListMap);
        	system.debug('AccountListMap SIZE Values '+ AccountListMap.size());
        
        	List<User> UserList = [SELECT Id, name, Username, IsActive FROM user WHERE Id IN : AccountListMap.Keyset()];
	        for(User Users : UserList) {
	            UsersActiveMap.put(Users.Id, Users.IsActive);
	        }
	        system.debug('UsersActiveMap Values '+ UsersActiveMap);
        	
        	for(Account AccountOld : Trigger.Old) {
                OldAccountMap.put(AccountOld.Id, AccountOld);
            }
            system.debug('OldAccountMap Values '+ OldAccountMap);
            
            for(Id OwnerId : AccountListMap.Keyset()) {
	        	if(UsersActiveMap.get(OwnerId)) {
	        		List<Account> AccList = new List<Account>();
	        		AccList = AccountListMap.get(OwnerId);
	        		for(Account Acc : AccList) {
	        			//AccountMapNew.put(Acc.Id, Acc);
	        			if(!Acc.Active_Dealer__c)
                    		AccountsMarkedDeleted.add(Acc); 
                		else {
                    		//if(UsersActiveMap.get(AccountNew.OwnerId))
                        	NewAccountMap.put(Acc.Id, Acc);                                                       
                		}
	        		}
	            } 
	        }
        	system.debug('AccountsMarkedDeleted Values '+ AccountsMarkedDeleted);
        	system.debug('NewAccountMap Values '+ NewAccountMap);
            
            AccountTriggerClass.UpdateContactForActiveDealers(AccountsMarkedDeleted);
            AccountTriggerClass.UpdateTaskOnAccount(NewAccountMap, OldAccountMap);
       } 
    }
}

 

Hi,

I created a new Apex trigger in Account object.

 

trigger AccountTrigger on Account (before insert) {
    if(Trigger.IsInsert) {

        List<Account> AccountList = new List<Account>();
        Map<Id,Account> AccountMap = new Map<Id, Account>();
        Map<Id, Boolean> UsersActiveMap = new Map<Id, Boolean>();
        
        for(Account AccountNew : Trigger.New) {
            AccountMap.put(AccountNew.OwnerId, AccountNew);
        }
        system.debug('Account Map Values '+ AccountMap);
        system.debug('Account Map SIZE Values '+ AccountMap.size());
        
        List<User> UserList = [select Id, name, Username, IsActive from user where Id IN : AccountMap.Keyset()];
        for(User Users : UserList) {
            UsersActiveMap.put(Users.Id, Users.IsActive);
        }
        system.debug('UsersActiveMap Values '+ UsersActiveMap);
        
        for(Account Acc : AccountMap.Values()) {
            system.debug('AccountMap Size()' + AccountMap.size() + ' '+ Acc.OwnerId );
            if(UsersActiveMap.get(Acc.OwnerId)) {
                AccountList.add(Acc);
                system.debug('AccountList' + AccountList.size());    
            }
        }
        system.debug('AccountList Values '+ AccountList);
        if(Trigger.IsBefore) {
            system.debug('SSS AccountList Size()' + AccountList.size());
            AccountTriggerClass.UpdateCallFrequency(AccountList);
        }
    }    
}   

I run via data loader I have 20 records in CSV file.

I got only One record on line 12

system.debug('Account Map SIZE Values '+ AccountMap.size());

but I want 20.

Is anything I am missing..

 

 

 

Hi,

 

I created a new lead record via visual workflow and I binded that visual workflow into visualforce page.

 

Its working fine. But I need a latest created Lead record on visualforce page once I click the finish button on visual workflow.

 

I tried with finishlocation but its not working. Its just to move the home page only.

 

How to get that lead Id on visualforce page and redirect to the lead record?