• benkurian
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 2
    Replies
Hi All,

I have a master detail lookup field pointing master items but in that lookup window its showing only record id.Is there is any way to change the fields(instaed of record id i need to show master item name) in lookup serach results.It should be good for me to answer as soon as possible.thanks in advance.

Hi All,

 

I have a code with passing id  to apex class via visualforce page URL methode and that id i need to pass to another class.i will past the code for the same but its not working.Thanks in advance.

 

page one:

<apex:commandLink value="{!applicant.Deal_Name__c}"
                            action="/apex/Deal_Items?id={!applicant.Deal_Name__c}"> //by passing url to another page
                            <apex:param name="id" value="{!applicant.Deal_Name__c}" />

                        </apex:commandLink>

 

page two

{

//getting the id here but its not to getting page two Component controlle

 

}

 

page two controller:

public class pagetwocontroller{
 public String selectedName {get;set;}  
 public pagetwocontroller()  
 {  
   selectedName = ApexPages.currentPage().getParameters().get('id');  
 }

// some codes  

}

 

page two Component controller: 

{

 

how to get page-two-controller id  to this controller.

 

}

 

 

 

 

 

Hi All,


My name is Ben Kuriakose and I work as a junior salesforce developer in Tribuspoint Pune.Tribuspoint is US based company which specializes in oracle channel revenue implementation.we are looking forward to intergrate salesforce with oracle.As the only salesforce developer(beginer) in our firm,I need some assistance.Our company is willing to hire an external Developer for this purpose.if interested please contact me.Initial work would involve developing a custom app and then integrating with oracle.you can contact me at ben.kuriakose@tribuspoint.com.

 

Yours Sincerly,

Ben Kuriakose

 

Hi All,

 

I have a code with setter and getter method like below mentioned and i need to pass this method to inner class for getting the 'selectValue' in query string.Iam new to apex coding and please help me as soon as possible.Thanks in advance

 

public class outerclass{

public string selectvalue{get;set;} // iam using this getter and setter method  here.  while  running the code is showing an error with selectvalue is not defined.

public class innerclass1{

public Boolean success;
public String errorMessage;

}

public class innerclass2{

public String sobjname;
public String fields;

}

 @RemoteAction
 public static  innerclass1 query(innerclass2 qobj) {

 innerclass1 resp = new innerclass1();

 String qstr = 'SELECT' + qobj.fields + 'FROM ' + qobj.sobjname + ' WHERE Deal_Name__c = \'' + selectValue + '\'' ;

try {
          for (List<SObject> rlit : Database.query(qstr)) {
                for (SObject rit : rlit) {
                    if ((current_result >= qobj.start) && (current_result < (qobj.start + qobj.recordCount))) {
                        resp.records.add(rit);
                    }
                    current_result++;
                }
            }
        } catch (Exception e) {
            resp.success = false;
            resp.records = null;
            resp.errorMessage = e.getMessage();
            return resp;
        }
        return resp;

}

}

Hi am using extjs editable grid for updating records in sales force.i did how to uplaod the data into grid and after that i dont know how to update the row editing in grid.if any one knows the code for the same pls post it or will give an idea how to do it.Thanks in advance.

Hi,

 

i am  developing in line editing exactly what apex:enhencedlist do.but the save button is not working after editing.below is my code,please check and kindly rectify the error as soon as possible.thanks in advance.

 

visual force page:

 

<apex:page controller="Fund_Type_Controller">
    <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" />
    <apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/ui-lightness/jquery-ui.css" />
    <link rel="stylesheet"
        href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <!--  <script>
        
          function highlightElem(elem){
      
            $('tr').removeClass('ui-state-highlight');
            $(elem).addClass('ui-state-highlight');
        }
</script>    -->
    <!-- check all columns demo page -->
    <apex:form >
        <apex:pageblock title="Fund Type" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton value="Search" action="{!filterRecord}"
                    reRender="thePanelWrapper" />
            </apex:pageBlockButtons>
            <apex:pageBlockSection columns="2">
                <apex:inputField id="id3"
                    value="{!SearchCriteria.FUND_TYPE_NAME__c}" />
                <apex:inputField id="id2" value="{!SearchCriteria.FUND_TYPE__c}" />
                <apex:inputField id="id4" value="{!SearchCriteria.SHORT_CODE__c}" />
                <apex:inputField id="id5" value="{!SearchCriteria.ACCRUAL_RATE__c}" />
                <apex:inputField id="id6" value="{!SearchCriteria.PLAN_REQ_FLAG__c}" />
                <apex:inputField id="id7"
                    value="{!SearchCriteria.DEAL_DATE_REQ_FLAG__c}" />
                <apex:inputField id="id8"
                    value="{!SearchCriteria.DEAL_CUST_REQ_FLAG__c }" />
            </apex:pageBlockSection>
        </apex:pageblock>

        <apex:outputPanel id="thePanelWrapper">
            <apex:pageblock id="myblock" rendered="{!rend}">

                <apex:pageBlockButtons >
                    <apex:commandButton value="Save" action="{!tosave}" id="saveButton" />
                </apex:pageBlockButtons>

                <apex:pageblocktable value="{!Contacts}" var="c">
                    <!-- onRowClick="highlightElem(this) -->
                    <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectCheckboxes(this,'inputId')" />
                        </apex:facet>
                        <apex:inputCheckbox value="{!c.selected}" id="inputId">
                            <apex:actionSupport event="onclick" action="{!getSelected}"
                                reRender="hiddenBlock">
                                <apex:param name="para" value="{!c.con.id}" assignTo="{!para}" />
                            </apex:actionSupport>
                        </apex:inputCheckbox>
                    </apex:column>
                    <apex:column >
                        <apex:facet name="header">
                            <apex:outputText value="Action"></apex:outputText>
                        </apex:facet>
                        <apex:commandLink title="Edit">Edit</apex:commandLink> | <apex:commandLink title="Delete">Delete</apex:commandLink>
                    </apex:column>
                    <apex:column value="{!c.con.FUND_TYPE__c}" id="fname">
                        <apex:facet name="header">
                            <apex:commandLink value="Fund Type{!IF(sortExpression=='FUND_TYPE__c',IF(sortDirection='ASC','▼','▲'),'')}">
                                <apex:param value="FUND_TYPE__c" name="column"
                                    assignTo="{!sortExpression}"></apex:param>
                            </apex:commandLink>

                        </apex:facet>
                    </apex:column>
                    <apex:column value="{!c.con.FUND_TYPE_NAME__c}">
                        <apex:facet name="header">
                            <apex:commandLink value="Fund Type Name{!IF(sortExpression=='FUND_TYPE_NAME__c',IF(sortDirection='ASC','▼','▲'),'')}">
                                <apex:param value="FUND_TYPE_NAME__c" name="column"
                                    assignTo="{!sortExpression}"></apex:param>
                            </apex:commandLink>
                        </apex:facet>

                    </apex:column>

                    <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton" />
                </apex:pageblocktable>
            </apex:pageblock>
        </apex:outputPanel>
        <apex:pageBlock id="hiddenBlock" rendered="false"></apex:pageBlock>
    </apex:form>
    <script type="text/javascript">
  function selectCheckboxes(inpt,receivedInptID)
   {
     var inputCheckBox = document.getElementsByTagName("input");                 
     for(var i=0; i<inputCheckBox.length; i++)
      {         
       if(inputCheckBox[i].id.indexOf(receivedInptID)!=-1){                                    
          inputCheckBox[i].checked = inpt.checked;
       }
     }
   }
 </script>

    <script type="text/javascript">
   
function openWin(ReceiveInputID){
  var inputValue = document.getElementById(ReceiveInputID).innerHTML;
  console.log(ReceiveInputID,inputValue)
  $("#textfield").val(inputValue)
$("#dialog").dialog({
    buttons: {
        'Save': function saver() {},
        'Cancel': function() {$( this ).dialog( "close" );}
    }});
    }
    
    
</script>
    <body>
    <div id="dialog" title="Fund Type" style="display: none">Fund
    Name:<input type="text" id="textfield" /></div>
    </body>
</apex:page>

 

 

Controller:-

 

Public with sharing class Fund_Type_Controller {
    
Public List<contactwrapper> contactList {get;set;}
public TP_TPM_Fund_Type_TBL__c SearchCriteria{get;set;}
public TP_TPM_Fund_Type_TBL__c contact{get;set;}
public Id Id{get;set;}
List<TP_TPM_Fund_Type_TBL__c> selectedContacts = new List<TP_TPM_Fund_Type_TBL__c>();
public string message;
public Boolean rend { get; set; }
public String para{get;set{  para = value;}}
Public Fund_Type_Controller(){
        SearchCriteria=new TP_TPM_Fund_Type_TBL__c();
         TP_TPM_Fund_Type_TBL__c contact = new TP_TPM_Fund_Type_TBL__c();
         rend = false;
         
          }
public  PageReference filterRecord(){  
        rend=true;
        return null;
          }  
public String sortExpression{
        get{
        return sortExp;}
         set{
        if (value == sortExp)
        sortDirection = (sortDirection == 'ASC')? 'DESC' : 'ASC';
        else
        sortDirection = 'ASC';
        sortExp = value;}}

public String getSortDirection(){
        if (sortExpression == null || sortExpression == '')
         return 'ASC';
        else
         return sortDirection;}

private String sortDirection = 'ASC';
private String sortExp = 'name';
Public List<contactwrapper> getContacts(){
contactList = New List<contactwrapper>();
string sortFullExp = sortExpression  + ' ' + sortDirection;
String wcVal=SearchCriteria.FUND_TYPE__c + '%';
if (SearchCriteria.FUND_TYPE__c!=NULL){
            for(TP_TPM_Fund_Type_TBL__c c:(Database.query('Select FUND_TYPE__c,FUND_TYPE_NAME__c From TP_TPM_Fund_Type_TBL__c  where FUND_TYPE__c like :wcVal order by ' + sortFullExp + ' limit 1000'))){
            contactList.add(New contactwrapper(c));}
            return contactList;}
            else{
            for(TP_TPM_Fund_Type_TBL__c c:(Database.query('Select FUND_TYPE__c,FUND_TYPE_NAME__c From TP_TPM_Fund_Type_TBL__c   order by ' + sortFullExp + ' limit 1000'))){
            contactList.add(New contactwrapper(c));}
            return contactList;}}
 
public PageReference getSelected() {
    System.debug('param valueeeeeeeee'+para);
    selectedContacts.clear();
    for(contactwrapper conwrapper: contactList)
    if(conwrapper.selected == true)
    selectedContacts.add(conwrapper.con);
    return null;}

public List<TP_TPM_Fund_Type_TBL__c> GetSelectedContacts(){
       if(selectedContacts.size()>0)
    return selectedContacts;
    else
    ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select at least one Contact.'));
    return null;}
    

//save action methode after editing


public PageReference tosave() {
    if(selectedContacts.size()>0){
    update selectedContacts;
    PageReference FundType=new PageReference('/apex/FundType');
    FundType.setRedirect(true);
    return FundType;}
    else{
    ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select at least one Contact.'));
    return null;}}        
 
Public class contactwrapper{
       Public TP_TPM_Fund_Type_TBL__c con{get;set;}
       Public Boolean selected{get;set;}
     Public contactwrapper(TP_TPM_Fund_Type_TBL__c c){
    con = c;
    selected = false;}}


    
    
    
    
 }

 

 

 

 

Hi All,

 

I have a code with passing id  to apex class via visualforce page URL methode and that id i need to pass to another class.i will past the code for the same but its not working.Thanks in advance.

 

page one:

<apex:commandLink value="{!applicant.Deal_Name__c}"
                            action="/apex/Deal_Items?id={!applicant.Deal_Name__c}"> //by passing url to another page
                            <apex:param name="id" value="{!applicant.Deal_Name__c}" />

                        </apex:commandLink>

 

page two

{

//getting the id here but its not to getting page two Component controlle

 

}

 

page two controller:

public class pagetwocontroller{
 public String selectedName {get;set;}  
 public pagetwocontroller()  
 {  
   selectedName = ApexPages.currentPage().getParameters().get('id');  
 }

// some codes  

}

 

page two Component controller: 

{

 

how to get page-two-controller id  to this controller.

 

}

 

 

 

 

 

 

Hi,

 

I'm new in the plataform - I having some problems to fill in data in a ExtJs Panel Grid - When I got back the String in JSON format I define my Ext.Data.Model - I have some lookup up relations in my Query and I don't know how to define them in my Ext.Data.Model, the fields that don't have look up relationships work fine but I cant get the value from the ones that have it

 

If somebody can help me with this issue will be great!

 

Many thanks

Xisco :)

 

Here is my code:

 

<script type="text/javascript">

		Ext.ns("Ext.Classing"); //Defining a namespace is best practice in ExtJS
			
		
		Ext.onReady(function(){ //This is a execution point
			
			//This is to create InCourse panel
		    var InCoursePanel = new Ext.create('Ext.Classing.InCoursePanel', {   
		            renderTo: InCourse,
		            title : 'Students to place'
		        });
		        		    
	
	        //This method is used to call our controller method
	        Controller_ClassingSimpleGrid.getAllBookings(function(result, er){	        							
						                var res = Ext.decode(result);
						                store.loadData(res.Records);
	            					}, {escape:false});
   		});
   		
   		   		
   		//Defining a model, which is like an object
   		Ext.define('ClassingStudentsModel', {
	        extend	: 'Ext.data.Model',
	        fields	:[
			            {name: 'Id', type: 'string'},
			            {name: 'Name', type: 'string'},
			            {name: 'Gender__c', type: 'string'},
			            {name: 'Nationality__c', type: 'string'}
	    			  ]
	    });   		
   		
   		//Create a store, which is like collection of records with sorting and grouping capability
   		var store = Ext.create('Ext.data.Store', { 
	                        model 		: 'ClassingStudentsModel', //Associate your store with Model
	                        proxy 		: {
				                            type 	: 'memory',
				                            reader	: {
			                                	type : 'json',
				                          	}
	                       				  }
	                    });
   		
   		//Defining a panel in order to display our data
   		Ext.define('Ext.Classing.InCoursePanel', {
	        extend		: 'Ext.grid.Panel',
	        alias 		: 'widget.InCoursePanel',
	        name 		: 'InCoursePanel',
	        columnLines : true,
	        autoScroll	: true,
	        singleSelect: false,	        
	        border		: true,
	        height		: 300,
	        width		: 250,
	        store		: store, //Associate with our store
	        stripeRows  : true,
	        multiSelect : true,
	        columns 	: [ //Define the required columns
		                    {
		                        text 		: 'Id',
		                        dataIndex	: 'Id',
		                        flex		: 0.3
		                        //hidden      : true,
		                        //hideable    : false
		                    },
		                    {
		                        text 		: 'Name',
		                        dataIndex 	: 'Name',
		                        flex 		: 0.3
		                    },
		                    {
		                        text 		: 'Gender',
		                        dataIndex 	: 'Gender__c',
		                        flex 		: 0.3
		                    },
		                    {
		                        text 		: 'Nationality',
		                        dataIndex 	: 'Nationality__c',
		                        flex 		: 0.3
		                    }
		            	],
		});
global class Controller_SimpleGrid { 
    
@RemoteAction
    global static String getAllBookings() //Need to define as a remote action as we will be calling this through javascript
    {
        List<Booking__c> bookings = [Select Id, Enrolment__r.Account__r.Name, Enrolment__r.Account__r.Gender__c, 
                                                Enrolment__r.Account__r.Nationality__c
                                     From Booking__c
                                     Where Enrolment__r.Account__r.RecordType.Name = 'Student'];
                                     
    	system.Debug('Im here!!!!');                                     
                                     
        String JSONString = JSON.serialize(bookings);//This is how we can serailize our response into JSON format
        
        
        system.debug(JSONString);
        
        return '{\"Records\":' +JSONString+', \"error\": \"null\", \"status\":\"SUCCESS\", \"count\":\"' + bookings.size() + '\" }';
    }


}

 

 

 

 

 

  • July 16, 2012
  • Like
  • 0