• Rakesh M
  • NEWBIE
  • 20 Points
  • Member since 2015

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

Account object is not visible in tab list, Could you please me help in adding acount object in to the tab for new user.
User-added image
Hi,

My code is not giving an expected out put,  Kindly check and update me.  Please let me know how to get the data in rows. Below is my code.

public class Campaign1 {
    public list<Account> acc{set;get;}
    public campaign1(){
       acc=[SELECT Industry,Name FROM Account WHERE Industry = 'energy'];
        for(integer i=0; i<acc.size();i++){
            System.debug(acc);
        }
        }
    }

<apex:page controller="Campaign1" cache="true" contentType="text/csv#Campaign.csv" language="en-Us" >
    <apex:repeat value="{!acc}" var="a">"{!a.name}"
    </apex:repeat>
</apex:page>
Output:
United Oil & Gas Corp."XYZ Global Services (India)"YYY Broadcasting Pvt Ltd"XXX Academy For Skill And
Expected output:-
United Oil & Gas Corp.
XXX Academy For Skill And
YYY Broadcasting Pvt Ltd
XYZ Global Services (India)
  
Hi,

Visualforce page is not showing column header in customer portal.  Kindly check two images of visualforce page in adminstrator profile and customer portal profile.   Please let me know how to display the column headers in sites.  Below is the code.

public class outstanding {
    public list<f_97__c> f{set;get;}
    public outstanding(){
        f=[select type__c, assignment__c, Doc_Date__c, bline_date__c, total__c from f_97__c where sap_code__c= 'VF0209' limit 99];
    }
}
<apex:page controller="outstanding" sidebar="false" setup="false" showHeader="true">
    <apex:form >
        <apex:pageBlock title="Outstanding" >
            <apex:pageBlockTable value="{!f}" var="a" >                
                <apex:column value="{!a.Type__c}" headerValue="Type" />
                <apex:column value="{!a.Assignment__c}" headerValue="Invoice No"/>              
                <apex:column value="{!a.Doc_Date__c}" headerValue="DocDate" />
                <apex:column value="{!a.Bline_Date__c}" headerValue="Due Date" />                
                <apex:column value="{!a.Total__c}" headerValue="Amount" />                      
            </apex:pageBlockTable>        
        </apex:pageBlock>
    </apex:form>
</apex:page>

User-added image

User-added image
 
Admin Requirement:
When I click on add button one more InvoicelineItem  row should be added to pageBlockTable.
Please help me in achieving this functionality.
User-added image

User-added image
Code:
public class InvoiceLineItem {
    public string ProdName{set;get;}
    public decimal Quantity{set;get;}
    public decimal price{set;get;}
    public string tax{set;get;}
    public string productfamily{set;get;}
    public list<InvoiceLineItem__c> Ili{set;get;}
    public InvoiceLineItem__c I{set;get;}
    public InvoiceLineItem(){
        Ili= [select ProductName_c,Quantityc,Pricec,productc from InvoiceLineItem_c];        
    }
    public void Add(){
        Ili = new list<InvoiceLineItem__c>();
        I = new InvoiceLineItem__c();
        I.ProductName__c=ProdName;
        I.Quantity__c=Quantity;
        I.Price__c=Price;
        I.Product__c=productfamily;
        Ili.add(I);
        insert Ili;        
    }   
}
<apex:page controller="InvoiceLineItem">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!Ili}" var="a">
                <apex:column headerValue="ProdName">
                    <apex:inputText value="{!a.ProductName__c}"/>
                </apex:column>
                <apex:column headerValue="Quantity">
                    <apex:inputText value="{!a.Quantity__c}"/>
                </apex:column>
                <apex:column headerValue="Price">
                    <apex:inputText value="{!a.Price__c}"/>
                </apex:column>
                <apex:column headerValue="ProductFamily">
                    <apex:inputText value="{!a.Product__c}"/>
                </apex:column>
                <apex:column >
                    <apex:commandButton value="Add" action="{!Add}"/>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>


Thanks in advance.
Hi,

I have some data posted below in table No#1. When I select  value 'TS' through picklist, I'm not getting expected output as in Table No#2. After executing the code mentioned below. My output comes as in image No#1. Please help me in showing the data as expected in Table No#2.

Table No#1
CustomerName 1TypeAssignmentTotal
XKO_1234Aarushi TechnologyTSIDC03151311703,482.19
XKO_1234Aarushi TechnologyTSILL031526229510,435.92
XKO_1234Aarushi TechnologyBCUTIBR52015081700-4,704.41
XKO_1234Aarushi TechnologyVDCRIDC041636186-3,420.00
XKO_1234Aarushi TechnologyVDVPN0816977251328,477.71
XKO_1234Aarushi TechnologyABETH101205766037,122.82
XKO_1234Aarushi TechnologyBCILL0314200209968.23

Table No#2
CustomerName 1TypeAssignmentTotal
XKO_1234Aarushi TechnologyTSIDC03151311703,482.19
XKO_1234Aarushi TechnologyTSILL031526229510,435.92

Image No#1
User-added image

Code for Program:-
public class soql 
{
    public list<f_97__c> f{set;get;}
    public list<selectoption> options{set;get;} 
    public list<string> selected{set;get;}
    public string query {set;get;}
    public soql(){
        options =new list<selectoption>();
        selected=new list<string>();
        list<string> types = new list<string>{'TS','BC','VD','BR','AC','AB'};
        selectoption n = new selectoption('none','-None-');
        options.add(n);
        for(string s:types){
            selectoption op = new selectoption(s,s);
            options.add(op);
        }
    }
    public void method(){
        f=[select name_1__c, sap_code__c, assignment__c,type__c,total__c from f_97__c limit 999];
    }
    public void getdata(){        
        for(String s: selected)
        {       
            if(s!='none'){                          
                query ='select name_1__c, sap_code__c,assignment__c,type__c,total__c from f_97__c where type__c=:s';
            }
        }
        f=Database.query(query);
    }    
}
<apex:page controller="soql" tabStyle="lead">
 <apex:form >
 <apex:pageBlock title="f.97">
 <apex:pageBlockButtons location="top">
<apex:commandButton value="Outstanding" action="{!method}"/>
<apex:commandButton value="Filter" action="{!getdata}"/>
</apex:pageBlockButtons>
<apex:pageblocksection >
<apex:pageblocksectionitem >
<apex:outputtext value="Select Type"/>
<apex:selectList multiselect="true" value="{!selected}" size="1" >
 <apex:selectOptions value="{!options}" />
 </apex:selectList>
</apex:pageblocksectionitem>
</apex:pageblocksection>
<apex:pageBlockTable value="{!f}" var="a">
 <apex:column value="{!a.SAP_CODE__c}"/>
<apex:column value="{!a.Name_1__c}"/>
 <apex:column value="{!a.Type__c}"/>
 <apex:column value="{!a.Assignment__c}"/>
<apex:column value="{!a.Total__c}"/>
 </apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Thanks in advance.

Warm Regards,
Rakesh Mungelkar.
public class RecordCreations 
{
    public string name{set;get;}
    public account acc{set;get;}
    public contact con{set;get;}
    public pagereference createAccount()
    {
        acc=new account();
        acc.name=name;
        insert acc;
        pagereference pr = new pagereference('/'+acc.id);
        return pr;
    }
    public pagereference createContact()
    {
        con=new contact();
        con.lastname=name;
        insert con;
        pagereference p = new pagereference('/'+con.id);
        return p;
    }
}
<apex:page controller="RecordCreations">
    <apex:sectionHeader title="Record Creations" subtitle="Accounts & Contacts creations"/>
    <apex:form >
        <apex:pageBlock >
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Account" action="{!createAccount}"/>
            <apex:commandButton value="Contact" action="{!createContact}"/>
                </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:inputText Label="Enter Name : " value="{!name}"/>
            </apex:pageBlockSection>
            </apex:pageBlock>
    </apex:form>
</apex:page>

User-added image
After clicking account, the code works fine and below page comes.
User-added image
But when I click contact button, The error comes, request you to debug the error and let me know.
Thanks in advance.User-added image
public class OpportunityExample 
{
public date closedate{set;get;}
public string stagename{set;get;}
public decimal amount{set;get;}
public string name{set;get;}
public opportunity opp{set;get;}
public OpportunityExample()
{
opportunity opp=new opportunity();
opp.amount=amount;
opp.name=name;
opp.closedate=date.newinstance(2016,10,16);
opp.stagename='closedwon';
}
public pagereference xample()
{
insert opp;
pagereference pr = new pagereference('/'+opp.id);
return pr;
}
}
<apex:page controller="OpportunityExample">
 <apex:form >
 <apex:pageblock title="Opportunity">
 <apex:pageblockButtons location="bottom">
<apex:commandButton value="save" action="{!xample}"/>
 </apex:pageblockButtons>
 <apex:pageblocksection collapsible="false" columns="1">
 <apex:inputfield Label="Enter Name" Value="{!opp.name}"/>
<apex:inputfield Label="Enter Closed date" value="{!opp.closedate}"/>
<apex:inputfield Label="Enter the amount" value="{!opp.amount}"/>
<apex:inputfield Label="Enter stage name" value="{!opp.stagename}"/>
</apex:pageblocksection>
</apex:pageblock>
 </apex:form>
</apex:page>
User-added image
After pressing save, I am unable to go another page and error page comes, Please explain?
User-added image
My expected output page is below, Please help me in getting below page.
User-added image
 
Hi,

As I want to know count and full name of the searched key.  So I have written the below mentioned code.

But this code shows count properly not full name of the data.  Request you to help me.

list<list<Sobject>> Soslquery = [find 'rakesh*' in all fields returning account(name), f_97__c(name_1__c), contact(firstname)];
// Store the result set into the associated 

list<account> acc= ((list<account>) soslquery[0]);
system.debug('Count of searched word in account object are: '+acc.size());
list<f_97__c> f = ((list<f_97__c>) soslquery[1]);
system.debug('Count of searched word in f.97 object are: '+f.size());
list<contact> con=((list<contact>) soslquery[2]);
system.debug('Count of searched word in contact object are: '+con.size());

if(acc.size()>0)
{
    system.debug('Count of searched word in account object are: '+acc.size());
    for(account e:acc)
     {
     system.debug('Account name is:'+acc.name);
     }
}

if(f.size()>0)
{
    system.debug('Count of searched word in f.97 object are: '+f.size());
    for(f_97__c g:f)
    {
        system.debug('f_97__c name is: '+g.name_1__c);
    }
}

if(con.size()>0)
{
    system.debug('Count of searched word in contact object are: '+con.size());
     for(contact h:con)
     {
     system.debug('Contact name is : '+con.firstname);
     }
}
Hi,

My code is not giving an expected out put,  Kindly check and update me.  Please let me know how to get the data in rows. Below is my code.

public class Campaign1 {
    public list<Account> acc{set;get;}
    public campaign1(){
       acc=[SELECT Industry,Name FROM Account WHERE Industry = 'energy'];
        for(integer i=0; i<acc.size();i++){
            System.debug(acc);
        }
        }
    }

<apex:page controller="Campaign1" cache="true" contentType="text/csv#Campaign.csv" language="en-Us" >
    <apex:repeat value="{!acc}" var="a">"{!a.name}"
    </apex:repeat>
</apex:page>
Output:
United Oil & Gas Corp."XYZ Global Services (India)"YYY Broadcasting Pvt Ltd"XXX Academy For Skill And
Expected output:-
United Oil & Gas Corp.
XXX Academy For Skill And
YYY Broadcasting Pvt Ltd
XYZ Global Services (India)
  
public class RecordCreations 
{
    public string name{set;get;}
    public account acc{set;get;}
    public contact con{set;get;}
    public pagereference createAccount()
    {
        acc=new account();
        acc.name=name;
        insert acc;
        pagereference pr = new pagereference('/'+acc.id);
        return pr;
    }
    public pagereference createContact()
    {
        con=new contact();
        con.lastname=name;
        insert con;
        pagereference p = new pagereference('/'+con.id);
        return p;
    }
}
<apex:page controller="RecordCreations">
    <apex:sectionHeader title="Record Creations" subtitle="Accounts & Contacts creations"/>
    <apex:form >
        <apex:pageBlock >
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Account" action="{!createAccount}"/>
            <apex:commandButton value="Contact" action="{!createContact}"/>
                </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:inputText Label="Enter Name : " value="{!name}"/>
            </apex:pageBlockSection>
            </apex:pageBlock>
    </apex:form>
</apex:page>

User-added image
After clicking account, the code works fine and below page comes.
User-added image
But when I click contact button, The error comes, request you to debug the error and let me know.
Thanks in advance.User-added image
Hi,

As I want to know count and full name of the searched key.  So I have written the below mentioned code.

But this code shows count properly not full name of the data.  Request you to help me.

list<list<Sobject>> Soslquery = [find 'rakesh*' in all fields returning account(name), f_97__c(name_1__c), contact(firstname)];
// Store the result set into the associated 

list<account> acc= ((list<account>) soslquery[0]);
system.debug('Count of searched word in account object are: '+acc.size());
list<f_97__c> f = ((list<f_97__c>) soslquery[1]);
system.debug('Count of searched word in f.97 object are: '+f.size());
list<contact> con=((list<contact>) soslquery[2]);
system.debug('Count of searched word in contact object are: '+con.size());

if(acc.size()>0)
{
    system.debug('Count of searched word in account object are: '+acc.size());
    for(account e:acc)
     {
     system.debug('Account name is:'+acc.name);
     }
}

if(f.size()>0)
{
    system.debug('Count of searched word in f.97 object are: '+f.size());
    for(f_97__c g:f)
    {
        system.debug('f_97__c name is: '+g.name_1__c);
    }
}

if(con.size()>0)
{
    system.debug('Count of searched word in contact object are: '+con.size());
     for(contact h:con)
     {
     system.debug('Contact name is : '+con.firstname);
     }
}