• lucci
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 10
    Replies

Apexclass

--------------

public class accountwrapperclass
{
public list<accountwrapper> wrappers{get;set;}


public accountwrapperclass()
{
wrappers=new list<accountwrapper>();
wrappers.add(new accountwrapper());
}
public void addrow()
{
wrappers.add(new accountwrapper());
}
public void remove()
{

if(wrappers.size()>1)
wrappers.remove(wrappers.size()-1);

}
public void save()
{
list<account>acclist=new list<account>();
for(accountwrapper aw:wrappers)
{
acclist.add(aw.acc);
}
insert acclist;

}

public class accountwrapper
{
public account acc{get;set;}
public accountwrapper()
{
acc=new account();
}
}


}

 

test class

---------------

 

@istest
public class Accountwrapperclass_test{
static testMethod void validateTestMyClass() {
accountwrapperclass awc=new accountwrapperclass();

//awc.accountwrapper wrappers=new awc.accountwrapper();
//wrappers.acc.name='valli';
list<account> acclist=new list<account>();
for(account a:acclist){
a.Name='show';
acclist.add(a);
}
insert acclist;
delete acclist;
awc.save();
awc.remove();
awc.addrow();



}
}

 

I have only 70% codecoverage for that class.

 

public void addrow()
{
wrappers.add(new accountwrapper());
}
public void remove()
{

if(wrappers.size()>1)
wrappers.remove(wrappers.size()-1);

}

 

these lines are not cvered,

 

could pls anybody help me for increase code coverage

 

  • December 12, 2013
  • Like
  • 0

I have Two maps ,how can i merge these maps and display as 1map.

map<id,id>

map<id,id>

how to get 1 map,pls anybody help me

 thanks 

laks

  • December 10, 2013
  • Like
  • 0

public Map<String, Integer> getqueuesMap(){

Map<String, Integer> qMap = new Map<String, Integer>();
queuesMap = new Map<String, Id>();
//list<aggregateResult> res=[select group.name,count(ID) from GroupMember group by group.name];
List<Group> roleGrps = [Select Id from Group where Type='Role' AND RelatedId= : UserInfo.getUserRoleId()];
Set<Id> gIds = new Set<Id>();
for(GroupMember grpM : [Select Group.Id, Group.Name from GroupMember where UserOrGroupId IN: roleGrps OR UserOrGroupId =: UserInfo.getUserId()])
{
gIds.add(grpM.Group.Id);
//system.debug(gIds);
queuesMap.put(grpM.Group.Name, grpM.Group.id);
}

list<aggregateResult> results = [SELECT Owner.Name,Count(Id) FROM Case where OwnerId in :gIds group by Owner.Name];

//system.debug('agregateResults' +results);
for (AggregateResult ar : results){
qMap.put(String.valueOf(ar.get('Name')), (Integer) ar.get('expr0'));
}
/* if(qMap.size() != queuesMap.size()){
for(string names : queuesMap.keySet()){
if(String.isNotBlank(names) && !qMap.containsKey(names)){
qMap.put(names,0);
}
}
}*/

return qMap;
}

public void setqueuesmap(Map<String,Id> qmap){

this.queuesmap=qmap;

}

 

 

 

 

 

I am using this code for getting queuenames and count of queuenames, but i want queueids ,is it possible by nestedmaps if can ,how to change this code?

how to done can anybody help me?

 

thanks 

lakshmi

  • November 27, 2013
  • Like
  • 0

I need to display  whatever access queues names  for current login user,

 

Please anybody help me for this

 

 

  • November 21, 2013
  • Like
  • 0

My requirement is display the queues names for current loginuser.

 

can anybody help me for this query ?

 

Thanks in advance

  • November 20, 2013
  • Like
  • 0

accId = EncodingUtil.urlEncode((ApexPages.currentPage().getParameters().get('accId')==null)?'':ApexPages.currentPage().getParameters().get('accId'), 'UTF-8');

 

Thanks in advance

  • October 25, 2013
  • Like
  • 0

I need to display  whatever access queues names  for current login user,

 

Please anybody help me for this

 

 

  • November 21, 2013
  • Like
  • 0

My requirement is display the queues names for current loginuser.

 

can anybody help me for this query ?

 

Thanks in advance

  • November 20, 2013
  • Like
  • 0