• Force.platform
  • NEWBIE
  • 150 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 49
    Questions
  • 17
    Replies
Hi All,
I have test class where i am trying to create record with mailing state which is picklist, i am passong same state value as defined in field definition , still getting error.
Any idea about this.

 
In my org, user has two permission set:
1]Standard permission set: which restrict access to Tracking_Number__c field on Task Object
2]Custom Permission set: which grant aceess to Tracking_Number__c field on Task Object

Still this user is not able to accees this field in process builder. anybody has solution for this
i want test class for trigger that prevent duplicate record.
Trigger PreventDuplicateSR on BMCServiceDesk__Incident__c(Before insert)
{
  List<BMCServiceDesk__Incident__c>  allIncident = new  List<BMCServiceDesk__Incident__c>();
  allIncident = [SELECT Id, Name,BMCServiceDesk__FKClient__c,BMCServiceDesk__Service_Request_Title__c from BMCServiceDesk__Incident__c
                               Where BMCServiceDesk__Service_Request_Title__c = 'Tablet'
                                     OR BMCServiceDesk__Service_Request_Title__c = 'Tablet w/ Bluetooth Scanner'
                                     OR BMCServiceDesk__Service_Request_Title__c = 'FIT Team Device (Handheld)'
                                     OR BMCServiceDesk__Service_Request_Title__c = 'Laptop Computer '];
 
 
  for(BMCServiceDesk__Incident__c inc: trigger.new)
  {
      for(BMCServiceDesk__Incident__c oldInc: allIncident )
      {
          if(inc.BMCServiceDesk__FKClient__c == oldInc.BMCServiceDesk__FKClient__c
             && inc.BMCServiceDesk__state__c == True &&
             inc.BMCServiceDesk__Service_Request_Title__c == oldInc.BMCServiceDesk__Service_Request_Title__c)
              {
              inc.addError('You have already requested for this service');
              }
      }
  }     
 
}
I have Parent__C and child__C object with lookup rel.
there is one field on child__c ie. tracking_number__c.
i want this tracking number firld value on parent. how can i do?
How to call an Apex class / method from Salesforce Visual Workflow?
Hi all,
            I am new to salesforce n i want to learn AJAX in vf. but i am not geeting how to start? 
please suggest proper way and material to learn AJAX in vf
Hello All,
                 I am new to salesforce. I dont have any idea about soap api, REST api. but i have to learn it. 
Anybody please suggest,where i can learn api and how??
Hi All,

      I am new to saleforce, i have completed recruiting app. also i have little bit knowledge about trigger, classes n visuaforce page etc(from developer guide). but now i want a small project like small application creation and that involve everything like proper requiremet, object creation, relations, apex classes, trigger, visualforce pages, reports. 

Anyone has such small projects or any idea then please share . it  will very helpful.......
Hello All, I have trigger to create Revenueshare(child of opportunity) record if opportunity  stage=closewon and owner of opportunity and account is same, but trigger is not wrking.
trigger createRevenueShare on Opportunity (after insert, after update) {
   List<Revenue_Share__c> share= new List<Revenue_Share__c>();
   
   for(Opportunity opp:trigger.new)
   {
   if( opp.StageName== 'Close Won' && (opp.OwnerId == opp.Account.OwnerId))
   {
   Revenue_Share__c revShare= new Revenue_Share__c();
   revShare.Opportunity__c=opp.Id;
   share.add(revShare);
   }
   }
   insert share;
}
Hi all,
        my inputText component is not visible in column of pageBlockTable
vf:
<apex:page controller="Add_Participant_Page_Controller">
  <apex:form >
  <apex:pageBlock >
  <apex:commandButton title="Save Item" action="{!addItemWithoutParticipant}" value="Save Item"/>
  <apex:pageBlockTable value="{!addItem}" var="add">
  
  <apex:column headerValue="Item">
  <apex:inputText value="{!Name}" />
  </apex:column> 
  
  <apex:column headerValue="Quantity"> 
  <apex:inputText value="{!Quantity}"/>
  </apex:column>
  
  <apex:column headerValue="Rate"> 
  <apex:inputText value="{!Rate}"/>
  </apex:column>
  
  </apex:pageBlockTable>
  
  </apex:pageBlock>
  </apex:form>
</apex:page>
Controller:
public class Add_Participant_Page_Controller{

public List<Menu_Item__c> addItem{get; set;} 
public Integer Quantity{get; set;}
public String Name{get; set;}
public Integer Rate{get; set;}

 
 public pageReference addItemWithoutParticipant(){
  Menu_Item__c Item = new Menu_Item__c(Name=Name,Quantity__c=Quantity,Rate__c=Rate);
  addItem.add(Item);
  insert addItem ;
 return NULL;
 } 
}
Hi all,
I want to update CustomAmmount(Custom field) on parent(Opportunity) when child(OpportunityLineItem) updated
but its not working in after delete event
Trigger:
trigger UpdateCustomAmmount on OpportunityLineItem (after insert, after update, after Undelete,after delete) {
    if(Trigger.isAfter && (Trigger.isInsert || Trigger.isUpdate || Trigger.isUnDelete))
    {
    UpdateCustomAmmount_Handler.updateAmmount(Trigger.new);
    }
    
   /if(Trigger.isAfter ||Trigger.isDelete)
    {
      UpdateCustomAmmount_Handler.updateAmmount(Trigger.old);  
    }
}

Contoller:
public class UpdateCustomAmmount_Handler {
    public static void updateAmmount(List<OpportunityLineItem> olt)
    {
       
        List<Id> listIds = new List<Id>();
        system.debug('list of opp ids---'+listIds);
        
        for (OpportunityLineItem childItem : olt) {
            listIds.add(childItem.OpportunityId);
        }
        
          list<Opportunity> parentOpp = new List<Opportunity>([SELECT id, Custom_Ammount__c, Name,(SELECT ID, TotalPrice FROM OpportunityLineItems) FROM Opportunity WHERE ID IN :listIds]);
          system.debug('list of opp with child---'+parentOpp); 
          
        for(Opportunity opp:parentOpp)
               {
                   opp.Custom_Ammount__c = 0;
            for(OpportunityLineItem item:opp.OpportunityLineItems)
            {
               
                opp.Custom_Ammount__c += item.TotalPrice; 
               }
            }
        If(parentOpp.size()>0){
            update parentOpp;  
        }    
    }
}
 
Hello All,
      can anyone provide test class for following controller.
public class Account_Pagination_With_Notes {
    public List<Account> accList{get; set;}
    public List<Account_Notes__c> noteList{get; set;}
    public List<WrapperClass> wrapperList{get; set;} 
    
    public integer totalRecs = 0;
    public integer OffsetSize = 0;
    public integer LimitSize= 10;
    
    public Account_Pagination_With_Notes(){ 
     totalRecs =[select count() from account];
     system.debug('Total Account Records'+totalRecs);
     PaginationAccountNote();
     
    }
    
    public void FirstPage()
    {
        OffsetSize = 0;
        system.debug('offset on first page'+OffsetSize);
        updateAccountNote();
        PaginationAccountNote();
    }
    
    public void previous()
    {
        OffsetSize = OffsetSize - LimitSize;
        system.debug('offset on previous page'+OffsetSize);
        updateAccountNote();
        PaginationAccountNote();
    }
    
    public void next()
    {
        OffsetSize = OffsetSize + LimitSize;
        system.debug('offset on next page'+OffsetSize);
        updateAccountNote();
        PaginationAccountNote();
    }
    
    public void LastPage()
    {
        OffsetSize = totalrecs - math.mod(totalRecs,LimitSize);
        system.debug('offset on last page'+OffsetSize);
        updateAccountNote();
        PaginationAccountNote();
    }
    
    public boolean getprev()
    {
        if(OffsetSize == 0)
            return true;
        else
            return false;
    }
    
    public boolean getnxt()
    {
        if((OffsetSize + LimitSize) > totalRecs)
            return true;
        else
            return false;
    }
    
    public void PaginationAccountNote(){
        accList=[SELECT id, name, (SELECT id, name, Note__c from Account_Notes__r ORDER BY CreatedDate DESC LIMIT 1) from Account  ORDER BY NAME ASC LIMIT :LimitSize OFFSET :OffsetSize];
        
        wrapperList= new List<WrapperClass>();
      
        for(Account acc : accList){
            Account_Notes__c nte = new Account_Notes__c();
            
            if(acc.Account_Notes__r.size()>0){
                nte = acc.Account_Notes__r[0];
            }else{
             nte.Account__c = acc.Id;
         }
            
            wrapperList.add(new WrapperClass(acc,nte));
            system.debug('--------------'+wrapperList);
            
        }       
    }
    
    public void updateAccountNote(){
         list<Account_Notes__c> addNotes = new list<Account_Notes__c>();
         for(WrapperClass wrap : wrapperList){
            if(!String.isblank(wrap.noteRec.Note__c) || wrap.noteRec.Id != null){
                addNotes.add(wrap.noteRec);
            }   
         }
        
        upsert addNotes;
    }
    
    public class WrapperClass{
        public Account accRec {get; set;}
        public Account_Notes__c noteRec {get; set;}
        public WrapperClass(Account acc , Account_Notes__c note)
        {
            accRec = acc ;
            noteRec = note;
        }
        
    }
}
can we perform dml on wrapper class list?
 i want to perform upsert operation on wrapper class list.
wrapper class dispaly two object data on vf and also able to enter data in one object on vf. n now i have to perform upsert operation on this list.
Hello All,
  I have trigger that create no of contacts realted to account as per value entered in No_Of_Contact in account object.
Trigger:
trigger AllAccountTrigger on Account (after insert,after update, before insert, before update) {
    if(Trigger.isAfter)
    {   if(Trigger.isInsert || Trigger.isUpdate)
        { 
          AccountExample.createMultipleContact(Trigger.new);
        }
    }
    }

class method:
 public static void createMultipleContact(List<Account> acc){
         List<Contact> c= new List<Contact>();
         for( Account a:acc){
          if(a.Create_Contact__c= true && a.No_Of_Contacts_to_create__c!= 0){
          for(Integer i=1; i<=a.No_Of_Contacts_to_create__c;i++){
          Contact con=new Contact();
          con.FirstName=a.name;
          con.LastName =a.Account_Number__c+'-'+con.Contact_Count__c;
          con.Phone=a.phone;
          con.AccountId=a.Id;
          c.add(con); 
            }
            if(c.size()>0){
            insert c;
               }
              }
             }
            }
 
 but i getting error: System.FinalException: Record is read-only:
i have to pass parametet with commandbutton which is outside of table.
this is my vf: 
<apex:form styleClass="myFormStyle " >
  <center>
  <!----------------pageBlock--------------------------------------->
  <apex:pageBlock title="My Bucket"  >
  
  <apex:pageMessages id="msg"> </apex:pageMessages>
  <!-------------first section-display table and take quantity from user----------------->
  <apex:pageblockSection >
  <apex:pageBlockTable value="{!itemInBucket}" var="i">
   <apex:column value="{!i.Product_Name__c}" />
   
    <apex:column value="{!i.price__c}"  />
    
    <apex:column value="{!i.Quantity__c}" headerValue="Available Quantity"/ >
    
    <apex:column headerValue="Required Quantity" >
    <apex:commandButton value="+" action="{!incrementCounter}" reRender="bucket"/>
    <apex:inputText value="{!count}" style="width: 25px !important;" styleClass="qty " id="bucket"/>
    <apex:commandButton value="-" action="{!decrementCounter}" reRender="bucket"/>
    </apex:column>
    
    <apex:Column >
    <apex:commandLink value="Place Order" action="{!placeOrderForSinglePro}" >
    <apex:param name="Pname" value="{!i.Product_Name__c}"/>
    <apex:param name="price" value="{!i.price__c}" />
     <apex:param name="quantity" value="{!i.Quantity__c}" />
    </apex:commandLink>
    </apex:column>
    
    <apex:Column >
    <apex:commandLink value="cancel" action="{!cancelOrder}" rendered="true" >
    </apex:commandLink>
    </apex:column>
    </apex:pageBlockTable> 
    </apex:pageblockSection>
    <!---------------------second section- take address and name from user--------------->
    <apex:pageBlockSection >
    <apex:inputText value="{!n}" label="Name" />
    <apex:inputTextarea title="Address" value="{!a}" label="Address"/>
    </apex:pageBlockSection>
   
   <!---------------commandButton is in pageBlock------------------------------->
   <apex:commandButton value="Place Order for All Products" action="{!placeOrderForAllPro}"/>
  </apex:pageBlock>
  </center>
  
  <apex:commandLink value="View Order" action="{!openOrderPage}"/>
  <apex:commandLink value="Previous Page" style="float:right;" action="{!redirect}"/>
  </apex:form>
</apex:page>

here i am taking quantity name and address from user and storing all that into Order__C object. now my inputFileds are in diffrent pageBlockSection and my command button is in pageBlock. so how can i insert  that  to Order__c when i click on commandButton.
I have to pass quantity and  price of product with commandbutton which is out of pageBlockTable.
<center> <!--------------category selection result-------------->
              <apex:pageBlock rendered="{!showpageblocktable}" >
              <center>
              <apex:pageBlockTable value="{!selectedProWrapper}" var="p" >
             
             <apex:column style="width:25%">
                    <apex:inputCheckBox value="{!p.selected}"/>
               </apex:column>
               
               <apex:column style="width:25%" headerValue="Product Name">
               <apex:outputLink title="View Product Detail" onclick="return openPopUp('{!p.Eprod.id}') ">
               {!p.Eprod.name}
               </apex:outputLink>
               </apex:column>
               
              <apex:column headerValue=" Image">
                <apex:outputText value="{!p.Eprod.Image__c}" escape="false" />
              </apex:column>
             
               <apex:column value="{!p.Eprod.Price__c}"/>
               
               <apex:column value="{!p.Eprod.Quantity__c}"/>
               
               <apex:Column style="width:25%">
               <apex:commandLink value="Add to Bucket" action="{!AddToCartButton}" >
               <apex:param name="PQuantity" value="{!p.Eprod.Quantity__c}"/>
               <apex:param name="price" value="{!p.Eprod.Price__c}"/> 
               <apex:param name="PId" value="{!p.Eprod.Id}"/>
               </apex:commandLink>
               </apex:column>
                             
              </apex:pageBlockTable>
              </center>
              <!--@@@@@@@@@@ here i have to pass quantity and price @@@@@@------->
              <apex:commandButton value="Add All to Bucket" action="{!AddToCartButton}" >
              <apex:param name="PQuantity" value="{!p.Eprod.Quantity__c}"/>
               <apex:param name="price" value="{!p.Eprod.Price__c}"/> 
               <apex:param name="PId" value="{!p.Eprod.Id}"/>
              </apex:commandButton>
              </apex:pageBlock>
              </center>
                              
    </apex:form>
</apex:page>

but i am getting error:
Error: Unknown property 'Landing_Page_Controller.p'    becoz this commandButton is outside of pageBlockTable and 'P' is variable of pageBlockTable. so how i can do this?
I have to display product image in pageBlockTable:
vf:
<apex:column>
                  <apex:image value="servlet/servlet.FileDownload?file={!p.Image__c}" height="50" width="50"/>
</apex:column>
image is stored in document:
url--https://c.ap6.content.force.com/servlet/servlet.FileDownload?file=0150K000006JMkx 

but image is not displaying in columns properly

 
Hello, 
I have visualforce page, that recive input value from user. page have twi fields inputText(name),inputText(name) and InputTextArea(Address),
i want to add validation that, when user click on save button, these three fields should not empty.
public class EComm_Bucket_Controller 
{public String n{get; set;}
public String a{get; set;}
public Integer q{get; set;}

public pageReference placeOrderForSinglePro()
  {
    Id Prodname=ApexPages.currentPage().getParameters().get('Pname');
    Decimal Proprice = Decimal.valueOf(ApexPages.currentPage().getParameters().get('price'));
   if(!(n!=null))
   {
   
    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter value'));
   }else
   {
    EOrder__c ord=new EOrder__c(EP_del__c=Prodname,
                                OQuantity__c=q,
                                Contact_Name__c=n,
                                Delivery_Address__c=a,
                                Order_Status__c='Placed',
                                Total_Order_Ammount__c=q*Proprice );
    insert ord;
    }
}

I have added <apex:pageMessage> on vf. but its not working. i have to check for 3 fields. Oquantity is number field. 
Hello all, 
i have inputText and InputTextArea field on vf and i want to give label to them. how can i do that? 
<apex:pageblockSection> 
<apex:inputText title="Name" value="{!n}" />
<apex:inputTextarea title="Address" value="{!a}"/>
 </apex:pageblockSection> 
Hello All,
        I am new to salesforce, my requirment is, i have pageBlockTbale that recive data from user and i have anather two text and textArea field outside of table that fields also recive user input. n i want to save all data in one object when user click on save button. how can we do this?
i have to write trigger for,
When Opportunity ‘Close Date’  is populated, should not be less than current date and time. If it is less, show an appropriate error msg.
how to do this?

 
i am trying to create contact upon account insertion
public static Account createContact()
   {   List<account> acc= new List<Account>();
       for(Account a : Trigger.new)
       {
       Contact c=new Contact();
       C.LastName='Sharma';
       c.Description=a.name;
       acc.add(c);
       } 
        insert acc;     
   }
but there is error    
unexpected token: 'Account'
I have Parent__C and child__C object with lookup rel.
there is one field on child__c ie. tracking_number__c.
i want this tracking number firld value on parent. how can i do?
Hi All,

      I am new to saleforce, i have completed recruiting app. also i have little bit knowledge about trigger, classes n visuaforce page etc(from developer guide). but now i want a small project like small application creation and that involve everything like proper requiremet, object creation, relations, apex classes, trigger, visualforce pages, reports. 

Anyone has such small projects or any idea then please share . it  will very helpful.......
Hello All, I have trigger to create Revenueshare(child of opportunity) record if opportunity  stage=closewon and owner of opportunity and account is same, but trigger is not wrking.
trigger createRevenueShare on Opportunity (after insert, after update) {
   List<Revenue_Share__c> share= new List<Revenue_Share__c>();
   
   for(Opportunity opp:trigger.new)
   {
   if( opp.StageName== 'Close Won' && (opp.OwnerId == opp.Account.OwnerId))
   {
   Revenue_Share__c revShare= new Revenue_Share__c();
   revShare.Opportunity__c=opp.Id;
   share.add(revShare);
   }
   }
   insert share;
}
Hi all,
I want to update CustomAmmount(Custom field) on parent(Opportunity) when child(OpportunityLineItem) updated
but its not working in after delete event
Trigger:
trigger UpdateCustomAmmount on OpportunityLineItem (after insert, after update, after Undelete,after delete) {
    if(Trigger.isAfter && (Trigger.isInsert || Trigger.isUpdate || Trigger.isUnDelete))
    {
    UpdateCustomAmmount_Handler.updateAmmount(Trigger.new);
    }
    
   /if(Trigger.isAfter ||Trigger.isDelete)
    {
      UpdateCustomAmmount_Handler.updateAmmount(Trigger.old);  
    }
}

Contoller:
public class UpdateCustomAmmount_Handler {
    public static void updateAmmount(List<OpportunityLineItem> olt)
    {
       
        List<Id> listIds = new List<Id>();
        system.debug('list of opp ids---'+listIds);
        
        for (OpportunityLineItem childItem : olt) {
            listIds.add(childItem.OpportunityId);
        }
        
          list<Opportunity> parentOpp = new List<Opportunity>([SELECT id, Custom_Ammount__c, Name,(SELECT ID, TotalPrice FROM OpportunityLineItems) FROM Opportunity WHERE ID IN :listIds]);
          system.debug('list of opp with child---'+parentOpp); 
          
        for(Opportunity opp:parentOpp)
               {
                   opp.Custom_Ammount__c = 0;
            for(OpportunityLineItem item:opp.OpportunityLineItems)
            {
               
                opp.Custom_Ammount__c += item.TotalPrice; 
               }
            }
        If(parentOpp.size()>0){
            update parentOpp;  
        }    
    }
}
 
can we perform dml on wrapper class list?
 i want to perform upsert operation on wrapper class list.
wrapper class dispaly two object data on vf and also able to enter data in one object on vf. n now i have to perform upsert operation on this list.
i have to pass parametet with commandbutton which is outside of table.
this is my vf: 
<apex:form styleClass="myFormStyle " >
  <center>
  <!----------------pageBlock--------------------------------------->
  <apex:pageBlock title="My Bucket"  >
  
  <apex:pageMessages id="msg"> </apex:pageMessages>
  <!-------------first section-display table and take quantity from user----------------->
  <apex:pageblockSection >
  <apex:pageBlockTable value="{!itemInBucket}" var="i">
   <apex:column value="{!i.Product_Name__c}" />
   
    <apex:column value="{!i.price__c}"  />
    
    <apex:column value="{!i.Quantity__c}" headerValue="Available Quantity"/ >
    
    <apex:column headerValue="Required Quantity" >
    <apex:commandButton value="+" action="{!incrementCounter}" reRender="bucket"/>
    <apex:inputText value="{!count}" style="width: 25px !important;" styleClass="qty " id="bucket"/>
    <apex:commandButton value="-" action="{!decrementCounter}" reRender="bucket"/>
    </apex:column>
    
    <apex:Column >
    <apex:commandLink value="Place Order" action="{!placeOrderForSinglePro}" >
    <apex:param name="Pname" value="{!i.Product_Name__c}"/>
    <apex:param name="price" value="{!i.price__c}" />
     <apex:param name="quantity" value="{!i.Quantity__c}" />
    </apex:commandLink>
    </apex:column>
    
    <apex:Column >
    <apex:commandLink value="cancel" action="{!cancelOrder}" rendered="true" >
    </apex:commandLink>
    </apex:column>
    </apex:pageBlockTable> 
    </apex:pageblockSection>
    <!---------------------second section- take address and name from user--------------->
    <apex:pageBlockSection >
    <apex:inputText value="{!n}" label="Name" />
    <apex:inputTextarea title="Address" value="{!a}" label="Address"/>
    </apex:pageBlockSection>
   
   <!---------------commandButton is in pageBlock------------------------------->
   <apex:commandButton value="Place Order for All Products" action="{!placeOrderForAllPro}"/>
  </apex:pageBlock>
  </center>
  
  <apex:commandLink value="View Order" action="{!openOrderPage}"/>
  <apex:commandLink value="Previous Page" style="float:right;" action="{!redirect}"/>
  </apex:form>
</apex:page>

here i am taking quantity name and address from user and storing all that into Order__C object. now my inputFileds are in diffrent pageBlockSection and my command button is in pageBlock. so how can i insert  that  to Order__c when i click on commandButton.
I have to pass quantity and  price of product with commandbutton which is out of pageBlockTable.
<center> <!--------------category selection result-------------->
              <apex:pageBlock rendered="{!showpageblocktable}" >
              <center>
              <apex:pageBlockTable value="{!selectedProWrapper}" var="p" >
             
             <apex:column style="width:25%">
                    <apex:inputCheckBox value="{!p.selected}"/>
               </apex:column>
               
               <apex:column style="width:25%" headerValue="Product Name">
               <apex:outputLink title="View Product Detail" onclick="return openPopUp('{!p.Eprod.id}') ">
               {!p.Eprod.name}
               </apex:outputLink>
               </apex:column>
               
              <apex:column headerValue=" Image">
                <apex:outputText value="{!p.Eprod.Image__c}" escape="false" />
              </apex:column>
             
               <apex:column value="{!p.Eprod.Price__c}"/>
               
               <apex:column value="{!p.Eprod.Quantity__c}"/>
               
               <apex:Column style="width:25%">
               <apex:commandLink value="Add to Bucket" action="{!AddToCartButton}" >
               <apex:param name="PQuantity" value="{!p.Eprod.Quantity__c}"/>
               <apex:param name="price" value="{!p.Eprod.Price__c}"/> 
               <apex:param name="PId" value="{!p.Eprod.Id}"/>
               </apex:commandLink>
               </apex:column>
                             
              </apex:pageBlockTable>
              </center>
              <!--@@@@@@@@@@ here i have to pass quantity and price @@@@@@------->
              <apex:commandButton value="Add All to Bucket" action="{!AddToCartButton}" >
              <apex:param name="PQuantity" value="{!p.Eprod.Quantity__c}"/>
               <apex:param name="price" value="{!p.Eprod.Price__c}"/> 
               <apex:param name="PId" value="{!p.Eprod.Id}"/>
              </apex:commandButton>
              </apex:pageBlock>
              </center>
                              
    </apex:form>
</apex:page>

but i am getting error:
Error: Unknown property 'Landing_Page_Controller.p'    becoz this commandButton is outside of pageBlockTable and 'P' is variable of pageBlockTable. so how i can do this?
I have to display product image in pageBlockTable:
vf:
<apex:column>
                  <apex:image value="servlet/servlet.FileDownload?file={!p.Image__c}" height="50" width="50"/>
</apex:column>
image is stored in document:
url--https://c.ap6.content.force.com/servlet/servlet.FileDownload?file=0150K000006JMkx 

but image is not displaying in columns properly

 
Hello, 
I have visualforce page, that recive input value from user. page have twi fields inputText(name),inputText(name) and InputTextArea(Address),
i want to add validation that, when user click on save button, these three fields should not empty.
public class EComm_Bucket_Controller 
{public String n{get; set;}
public String a{get; set;}
public Integer q{get; set;}

public pageReference placeOrderForSinglePro()
  {
    Id Prodname=ApexPages.currentPage().getParameters().get('Pname');
    Decimal Proprice = Decimal.valueOf(ApexPages.currentPage().getParameters().get('price'));
   if(!(n!=null))
   {
   
    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter value'));
   }else
   {
    EOrder__c ord=new EOrder__c(EP_del__c=Prodname,
                                OQuantity__c=q,
                                Contact_Name__c=n,
                                Delivery_Address__c=a,
                                Order_Status__c='Placed',
                                Total_Order_Ammount__c=q*Proprice );
    insert ord;
    }
}

I have added <apex:pageMessage> on vf. but its not working. i have to check for 3 fields. Oquantity is number field. 
Hello All,
   I have vf page, on this i have search functionality, when i enter any product name in serch box then related products display in pageBlock  in table format. but requirement, this pageBlock should dispaly only after when we click on search button, not before.
below is my code,
<apex:commandButton value="Clear Products" action="{!clear}" style="float:right;" reRender="panel"/> 
       <apex:commandButton value="Search Products" action="{!search}" style="float:right;"/>
       <apex:inputText value="{!searchstring}" label="Input" style="float:right;"/>
       
       <!-- pageBlockTable for search result-->
       <apex:outputPanel id="panel">
        <apex:pageBlock title="Search Result"> 
        <apex:pageblockTable value="{!SerchPro}" var="a"> 
        <apex:column headerValue="Product Name">
               <apex:outputLink title="View Product Detail" onclick="return openPopUp('{!a.id}') ">
               {!a.name}
               </apex:outputLink>
               </apex:column>
         <!-- <apex:column value="{!a.Quantity__c}"/>-->
        <apex:column >
        <apex:commandLink value="Add to Bucket" action="{!AddToCartButton}">
        <apex:param name="PQuantity" value="{!a.Quantity__c}"/> 
        <apex:param name="PId" value="{!a.Id}"/>
        </apex:commandLink>
        </apex:column>
        
       </apex:pageBlockTable> 
      </apex:pageBlock> 
      </apex:outputPanel> 
I have two objects:
1)EProduct__c with field Quantity__C
2)EOrder__C with field OQuantity__c
my req. is when order get placed Quantity on product should get reduce as per quantity in order
 
i want to write trigger to popolate account owner name into SalesRep__c(Text) field on the account object.
can we update lookup field value by workflow rule?