• rohitash yadav
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 14
    Questions
  • 4
    Replies
Hi,

I need to show a list of those leads on which any task or call is created. I have wrote the following query but it is not working.

Select Id, Name from Lead where Id IN (SELECT Who.Id FROM Task where Who.Type='Lead') limit 10

Can anyone help me?

Thanks,
Rohitash
Hi,

I have a website in php. If any order place on my website then I want to save all order related information to salesforce account. What is the best way to do this ?  How to avoid governer limits for this also?

Thanks,
Rohitash

 
Hi,

I have some records with checkbox for each record. When I checked any checkbox then I need to add new row to another table. In the new row I also need some input boxes with some actions. After that I need to save all these records.

My Visualforce page is :
 
<apex:page standardController="Line_Item__c" extensions="LineItemPackagesExtensions" recordSetVar="lineitems" >
	<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"/>
	<script type="text/javascript">
		function addPackage(pkgid){
			Visualforce.remoting.Manager.invokeAction(
		                '{!$RemoteAction.LineItemPackagesExtensions.getPackage}',
                		pkgid,
		                function(result, event){
                			$('#OpporPackages tr:last').after('<tr class="child"><td>Remove</td><td>Add</td><td>'+result.Name+'<\/td><td>'+result.Product_Category__c+'<\/td><td>'+result.Cost__c+'<\/td><td><apex:inputText value="{!result.Cost__c}"/><\/td><td>'+result.Name+'<\/td></tr>');
                    			alert(result.Name)
		                },
		                {escape: true}
            		);
		}
	</script>
	<apex:form >
        	<apex:pageBlock title="Selected Packages">
            		<apex:pageBlockButtons location="top">
				<apex:commandButton value="Save" action="{!save}"/>
                		<apex:commandButton value="Cancel" action="{!cancel}"/>
            		</apex:pageBlockButtons>
            		<table class="list" id="OpporPackages">
                		<thead>
                    			<tr>
                	       			<th></th>
		                        	<th></th>
                        			<th>Product Name</th>
		                        	<th>Product Category</th>
                		        	<th>Price</th>
		                        	<th>Final Price</th>
                		        	<th>No of Days</th>
		                        	<th>No of People</th>
		                        	<th>No of Male</th>
		                        	<th>No of Female</th>
		                        	<th>Total Price</th>
		                        	<th>Comments</th>
					</tr> 
	                	</thead>
        	        	<tbody>
                	    		<tr></tr>
		                </tbody>
        		</table>
        	</apex:pageBlock>
		<apex:pageBlock title="Search for Packages">
			<apex:outputPanel id="packagesList">
				<apex:pageBlockTable value="{!Packages}" var="a">
					<apex:column >
						<apex:actionsupport event="onclick" />
						<apex:inputCheckbox value="{!a.id}" onclick="addPackage('{!a.id}')"/>
					</apex:column>
					<apex:column value="{!a.Name}"/>
					<apex:column value="{!a.Product_Category__c}"/>
                    			<apex:column value="{!a.Cost__c}"/>
                    			<apex:column value="{!a.Stay__c}"/>
                    			<apex:column value="{!a.Activity__c}"/>
                    			<apex:column value="{!a.Description__c}"/>
                		</apex:pageBlockTable>
           		</apex:outputPanel>
        	</apex:pageBlock>
    	</apex:form>
</apex:page>

Apex Class is:
global with sharing class LineItemPackagesExtensions {

    public Package__c pkgs;
    public List<Package__c> Packages { get; set; }
    public static Package__c packageDetail{ get; set; }
    public String params{get;set;}
    public Package__c prdcat{get;set;}
    
   
    public LineItemPackagesExtensions(ApexPages.StandardSetController controller) {
        prdcat = new Package__c();
        Packages = [SELECT Name,Product_Category__c,Cost__c,Stay__c,Activity__c,Description__c FROM Package__c ];
    }

    @RemoteAction
    global static Package__c getPackage(String pkgid){
        packageDetail = [SELECT Name,Product_Category__c,Cost__c,Stay__c,Activity__c,Description__c FROM Package__c 
            where id=:pkgid ];
        return packageDetail;
    }
    
    public  List<Package__c> getPackages(){
        Packages = [SELECT Name,Product_Category__c,Cost__c,Stay__c,Activity__c,Description__c FROM Package__c ];
        return Packages;
    }
}
I don't know how to add text box in javascript code in visualforce page. Please help to achieve this.

Thanks,
Rohitash
Hi

I have some records listing on visualforce page . I want to filter these records based on selected value of custom picklist. I am not able to get selected value of this picklist in apex class.

My visualforce page is:
 
<apex:page standardController="Line_Item__c" extensions="LineItemPackagesExtensions" recordSetVar="lineitems" >
	<apex:pageBlock title="Search for Packages">
        	<apex:outputLabel >Packages Category</apex:outputLabel>
		<apex:inputField value="{!prdcat.Product_Category__c}" >
                	<apex:actionSupport event="onchange" rerender="packagesList" action="{!filterPackages}"/>
		</apex:inputField>
            	<apex:outputPanel id="packagesList">
                	<apex:pageBlockTable value="{!Packages}" var="a">
                    		<apex:column value="{!a.Name}"/>
                    		<apex:column value="{!a.Product_Category__c}"/>
                    		<apex:column value="{!a.Cost__c}"/>
                    		<apex:column value="{!a.Stay__c}"/>
                    		<apex:column value="{!a.Activity__c}"/>
                    		<apex:column value="{!a.Description__c}"/>
                	</apex:pageBlockTable>
           	</apex:outputPanel>
        </apex:pageBlock>
</apex:page>

Apex class is:
 
public class LineItemPackagesExtensions {

    public Package__c pkgs;
    public List<Package__c> Packages { get; set; }
    public Package__c prdcat{get;set;}
    


    public LineItemPackagesExtensions(ApexPages.StandardSetController controller) {
        Packages = [SELECT Name,Product_Category__c,Cost__c,Stay__c,Activity__c,Description__c FROM Package__c ];
    }

    public List<Package__c> getPackages(){
        Packages = [SELECT Name,Product_Category__c,Cost__c,Stay__c,Activity__c,Description__c FROM Package__c ];
        return Packages;
    }
    
    public void filterPackages() {
    	Packages = [SELECT Name,Product_Category__c,Cost__c,Stay__c,Activity__c,Description__c FROM Package__c 
           where Product_Category__c=:prdcat.Product_Category__c ];
    }

}

When I change the value of picklist it throws the following error

Attempt to de-reference a null object
Error is in expression '{!filterPackages}' in page addopportunitylineitem1: Class.LineItemPackagesExtensions.filterPackages: line 35, column 1


Please help to achieve this.
Thanks
Rohitash