• Vidhi
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 8
    Replies

Hello Friends,

I am  having partner portal.In sales force i have created two lead layout. just say A and B.   A is for salesforce crm and B is for partner portal.When i am creating the lead from salesforce it is auto matically taking lead record type A. But when i am creating the lead from partner portal  i have to select record type from the picklist.
I dont want the record type picklist  or just default value B(not editable) .


How can i do the same????????


Thanks

Hello Friend I am getting the error of attemt to de-reference a null object.I am trying to giving product in quote line item

public class CLS_NewQuoteLineItems {
public string surl='';
public string pricebookentry {get;set;}

public string name{get;set;}
public id qid{get;set;}
public boolean b{get;set;}
public boolean b1{get;set;}
public boolean b2{get;set;}
public List<WrapperProduct> prodlist ;
public List<WrapperProduct> selectprodlist {get;set;}
public list<product2> plist{get;set;}
public list<product2> plists{get;set;}
public quote q;

public list<Quotelineitem> qlist{get;set;}
public CLS_NewQuoteLineItems(){

b1=false;

qlist=new list<Quotelineitem>();
surl = ApexPages.currentPage().getUrl();
if(surl.contains('0Q0'))
{
q=new quote();
qid=ApexPages.currentPage().getParameters().get('id');
q=[select name,Pricebook2Id from quote where id=:qid];
name=q.name;
}
if(q.Pricebook2id==null)
{
b2=true;
b=false;
}
else
{
b=true;
b2=false;
}
plist=new list<product2>();
prodlist=new List<WrapperProduct>();
selectprodlist=new List<WrapperProduct>();
plist=[select name,ProductCode ,Family,Description from product2];
system.debug('ppppppppppppp'+plist);

 

}

 

public List<WrapperProduct> getprodlist () {

integer i = 0;


for(product2 p: plist)
{


WrapperProduct lw = new WrapperProduct(p);
prodlist.add(lw);
i++;
}
system.debug('222222222222'+prodlist);
return prodlist;


}

public pageReference selectproduct()
{
b=false;
b1=true;
b2=false;
plists=new list<product2>();
for (WrapperProduct wp : prodlist)
{
if (wp.checked)
{
plists.add(wp.pro);
selectprodlist.add(wp);
}
}

System.debug('@@@@@selected product@@@@@@@'+ selectprodlist);
return null;
}

public pageReference CancelRec()
{

pagereference pr = new pagereference('/apex/VF_QuoteDetailPage?id='+qid);
return pr;
}

public void savepricebook()
{

b2=false;
b=true;
b1=false;
Pricebook2 prc=new Pricebook2();
system.debug('ppppppricebookpppppppp'+pricebookentry);
prc=[select id,Name from Pricebook2 where name=:pricebookentry];
system.debug('ppppppppppppp'+plist);

if(q.Pricebook2Id==null)
{
q.Pricebook2Id=prc.id;
update q;
}
system.debug('aaaaaaaaaaaa'+plist);
system.debug('WWWWWaupdatedquoteaaa'+q);

}
public pageReference insertQuoteItem()
{
System.debug('@@@@@selected product@@@on insertion@@@@'+ selectprodlist);

pricebookentry pEntry = new pricebookentry();
pEntry=[select Id,Pricebook2Id from PricebookEntry where Pricebook2Id=:q.Pricebook2Id limit 1];
product2 pronew=new product2();
for(WrapperProduct p:selectprodlist)
{

Quotelineitem qa=new Quotelineitem();
qa.pricebookentryId= pEntry.id;
qa.pricebookentry.product2id=p.prodid;***********//For this line i am getting the error.
qa.UnitPrice=p.salesprice;
qa.QuoteId=qid;
qa.Quantity=p.Quan;
qa.Description=p.LineItemDescription;
qlist.add(qa);

}
System.debug('uuuuuuuuuuuuuuu'+ qlist);
System.debug('u4444444444444444'+ selectprodlist);
insert qlist;
System.debug('iiiiiiiiiiiii'+qlist);
pagereference pr = new pagereference('/apex/VF_QuoteDetailPage?id='+qid);
return pr;
//return null;
}

public class WrapperProduct
{
public boolean checked {get;set;}
public string productName{get;set;}
public string productcode{get;set;}
public Decimal listprice{get;set;}
public string productdescription{get;set;}
public string productfamily{get;set;}
public id prodid{get;set;}
public product2 pro{get;set;}
public Integer Quan{get;set;}
public Integer Discount{get;set;}
public String LineItemDescription{get;set;}
public Decimal salesprice{get;set;}


public WrapperProduct()
{
checked = false;

}

public WrapperProduct(product2 p)
{
// pro=p;
prodid=p.id;
productName =p.name;
productcode=p.ProductCode;
productdescription=p.Description;
productfamily = p.Family;
}
}
}

 

how can i remove this

Hello Friends ,

 

I am trying to insert quote line item list but it is giving error.I am not able to understand why i am getting this error.

ublic class CLS_NewQuoteLineItems {
public string surl='';
public string name{get;set;}
public id qid{get;set;}
public boolean b{get;set;}
public boolean b1{get;set;}
public List<WrapperProduct> prodlist ;
public List<WrapperProduct> selectprodlist {get;set;}
public list<product2> plist{get;set;}
public list<product2> plists{get;set;}
public quote q;
public list<Quotelineitem> qlist{get;set;}
public CLS_NewQuoteLineItems(){
b=true;
b1=false;
qlist=new list<Quotelineitem>();
surl = ApexPages.currentPage().getUrl();
if(surl.contains('0Q0'))
{
q=new quote();
qid=ApexPages.currentPage().getParameters().get('id');
q=[select name from quote where id=:qid];
name=q.name;
}
plist=new list<product2>();
prodlist=new List<WrapperProduct>();
selectprodlist=new List<WrapperProduct>();
plist=[select name,ProductCode ,Family,Description from product2];
system.debug('ppppppppppppp'+plist);

 

}
public List<WrapperProduct> getprodlist () {

integer i = 0;


for(product2 p: plist)
{


WrapperProduct lw = new WrapperProduct(p);
prodlist.add(lw);
i++;
}
system.debug('222222222222'+prodlist);
return prodlist;


}

public pageReference selectproduct()
{
b=false;
b1=true;
plists=new list<product2>();
for (WrapperProduct wp : prodlist)
{
if (wp.checked)
{
plists.add(wp.pro);
selectprodlist.add(wp);
}
}

System.debug('@@@@@@@@@@@@'+ selectprodlist);
return null;
}

public pageReference CancelRec()
{

pagereference pr = new pagereference('/apex/VF_QuoteDetailPage?id='+qid);
return pr;
}
public pageReference insertQuoteItem()
{

for(product2 p:plists)
{
Quotelineitem q=new Quotelineitem();
q.pricebookentry.product2id='01tA0000003IUkaIAG';//Here i am getting error.
q.QuoteId=qid;
q.Quantity=1;
q.Description='test';
qlist.add(q);

}
System.debug('uuuuuuuuuuuuuuu'+ qlist);
insert qlist;
pagereference pr = new pagereference('/apex/VF_QuoteDetailPage?id='+qid);
return pr;
}

public class WrapperProduct
{
public boolean checked {get;set;}
public string productName{get;set;}
public string productcode{get;set;}
public Decimal listprice{get;set;}
public string productdescription{get;set;}
public string productfamily{get;set;}
public id prodid{get;set;}
public product2 pro{get;set;}

public WrapperProduct()
{
checked = false;

}

public WrapperProduct(product2 p)
{
pro=p;
prodid=p.id;
productName =p.name;
productcode=p.ProductCode;
productdescription=p.Description;
productfamily = p.Family;
}
}
}

 

Urgent reply will be helpfull.

 

Thanks

Hello Friends,

 

I am trying to create a table where we can show the data by wrapper class.here is my code

public class CLS_LeadPagination {

public List<leadWrapper> leadlist {get;set;}
public list<lead> leads{get;set;}
public list<string> leadString{get;set;}

public CLS_LeadPagination()
{

leadlist= new List<leadWrapper>();
leads=new list<lead>();
leadString=new list<string>();
leads= [select name,Email from lead order by name];
leadWrapper objwrap;
for(lead l:leads)
{
objwrap=new leadWrapper();
objwrap.leadobj=l;
leadlist.add(objwrap);
leadString.add(l.name);
}
}
public ApexPages.StandardSetController con {
get {
if(con == null) {
con = new ApexPages.StandardSetController(Database.getQueryLocator([Select Id, Name FROM lead Order By Name ]));

con.setPageSize(10);
}
return con;
}
set;
}







public Boolean hasNext {
get {
return con.getHasNext();
}
set;
}
public Boolean hasPrevious {
get {
return con.getHasPrevious();
}
set;

}

public Integer pageNumber {
get {
return con.getPageNumber();
}
set;
}
public void first() {
con.first();
}

// returns the last page of records
public void last() {
con.last();
}
public void previous() {
con.previous();
}

// returns the next page of records
public void next() {
con.next();
}

// returns the PageReference of the original page, if known, or the home page.


public pageReference SelectRecord()
{

pageReference pr=new pageReference('/apex/VF_LeadNew_Edit_Page');
return pr;
}
public pageReference Cancel()
{

return null;
}

 

public class leadWrapper {

public Boolean checked{ get; set; }
public lead leadobj { get; set;}
public string leadname { get; set;}

public leadWrapper(){
leadobj = new lead();
leadname=leadobj.name;
checked = false;
}
}
}

++++++++++++++++++++++++++++++++
<apex:page controller="CLS_LeadPagination" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons location="top">
<apex:commandButton action="{!SelectRecord}" value="NewLead"/>

</apex:pageBlockButtons>
<apex:pageMessages />
<apex:pageBlockSection title="Leads - Page #{!pageNumber}" columns="1">
<apex:pageBlockTable value="{!leadlist}" var="lead">
<apex:column headerValue="Name">
<apex:outputLink value="/{!lead.leadobj.Id}/e">{!lead.leadobj.name} </apex:outputLink>
</apex:column>
<apex:column value="{!lead.leadobj.Email}" headerValue="Email"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:panelGrid columns="4">
<apex:commandLink action="{!first}">First</apex:commandlink>
<apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous</apex:commandlink>
<apex:commandLink action="{!next}" rendered="{!hasNext}">Next</apex:commandlink>
<apex:commandLink action="{!last}">Last</apex:commandlink>
</apex:panelGrid>
</apex:form>
</apex:page>

but here i dont want to display data using standard variable(!lead.leadobj.name).Is there is any way to take variable in wrapper class and showing the name of lead by that.

 

Any quick reply will be very helpfull

 

 

Hello Friends,

 

I am giving this input value and i want to access it in class .I took one variable of id type (Because it is a look field)

 

<apex:inputField value="{!TmMembobj.HS_Codes__c}" id="teammem"  />

I took one variable of id type and passed the value in that.But is giving null

 

hscode=TmMembobj.HS_Codes__c;

 

Any idea how to do the same????????????

 

Thanks in advance

Hello Friends,

 

I am developing a VF Page in which I am hiding a table with java script .It is hiding the table perfectly but it is leaving the space after hidding the table.How can i remove the space after hidding the image.

 

Thanks