• SFDC AVINASH
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 7
    Replies
Hi All i am trying to build a simple page where i list all the item avialbe, and next to each item there will be button to show a description of the item. When user press description button bellow the item descriptions should be display. Items and Descriptions are from different objects they are related by lookup (dont want Master child relation).

I am facing few issues.
1. How can i acheave the fuction when user press detail button, details are displayed.
2. Since Item and desciptions are related i tried joined SOQL to retrive the data from both the tables but i am not able to disply the Description object records.
(Note: Bellow code i replaced all the name of the Item object with Projec__c and Detail with Resource__c)
 
<apex:page controller="Main_Timesheet" sidebar="false" action="{!onloadfunction}">
     <apex:variable var="rownum" value="{!0}" />
    <apex:form >
        
      <apex:actionRegion >
             <apex:actionSupport event="onchange" reRender="entrytable"/>
            <apex:outputPanel id="entrytable" rendered="{!NOT(ISNULL(entrylist))}">
                 
                <apex:dataTable cellspacing="15" value="{!entrylist}" var="Project">                 
                    <apex:column >
                        <apex:variable var="rownum" value="{!rownum + 1}"/> 
                        <apex:outputText >
                        {!rownum}
                        </apex:outputText>
                    </apex:column>
                     <apex:column headervalue="QB#">
                <apex:inputfield value="{!Project.QB__c}" style="width:100px;" required="true" rendered="{!(ISNULL(Project.QB__c))}"/>
                <apex:outputfield value="{!Project.QB__c}" style="width:1300px;" /> 
                         
                    </apex:column>
				
                 
                 <apex:column headervalue="Project Desc">
                <apex:inputfield value="{!Project.Description__c}" style="width:100px;" required="true" rendered="{!(ISNULL(Project.Description__c))}"/>
                   <apex:outputfield value="{!Project.Description__c}" style="width:300px;"/>  
                    </apex:column>
                   
                 
                 <apex:column headervalue="Delivery Date">
                <apex:inputfield value="{!Project.Delivery_Date__c}" style="width:100px;" required="true" rendered="{!(ISNULL(Project.Delivery_Date__c))}" />
                    <apex:outputfield value="{!Project.Delivery_Date__c}" style="width:300px;"/>
                    </apex:column>
                 <apex:column >
                 <apex:commandlink action="{!Deleterow}" immediate="true"> <apex:param name="tentryid" value="{!Project.Id}"/> <apex:param name="rownumber" value="{!rownum}"/><apex:commandbutton value="Delete" /> </apex:commandlink>
                 </apex:column>
                    
               </apex:dataTable>
                     
                    </apex:outputPanel>
         
           
            <apex:commandButton value="Create New" action="{!CreateNew}"/>
          <apex:commandButton value="Save" action="{!Save}"/>
        </apex:actionRegion>
    </apex:form> 
</apex:page>
 
public class Main_Timesheet {
   // Public List<Projects__c> tentries;
   Public List<SObject> tentries;
	public Projects__c delattendeeList;
    Public List<Resource__c> ResourceList;


    public void onloadfunction(){
      //tentries = [select Id,QB__c,Description__c,Delivery_Date__c from Projects__c];
        tentries =  [SELECT Id, Name,QB__c,Description__c,Delivery_Date__c, (SELECT Project_Name__c FROM Resources__r) FROM Projects__c];
    }            

    public List<Projects__c> getentrylist(){
    if (tentries!=NULL && tentries.size()>0) 
       return tentries;
    else 
       return null;       
	}


// Create a new Project record.    
    Public void CreateNew(){
        system.debug('Add new project');
        Projects__c newProject = new Projects__c();
        tentries.add(newProject);
    }
    

    public PageReference save(){
        UPSERT tentries;
        return null;
    }    
    
     public PageReference Deleterow(){
     	Integer rowno  = Integer.valueOf(ApexPages.currentPage().getParameters().get('rownumber'));
		//delattendeeList = tentries.get(rowno-1);
		tentries.remove(rowno-1);
		UPSERT tentries;
        return null;
    }    
}

Though i am using "
tentries = [SELECT Id, Name,QB__c,Description__c,Delivery_Date__c, (SELECT Project_Name__c FROM Resources__r) FROM Projects__c];" i am not able to disply "Project_Name__c"

Thanks for your wonderful suggetions :) 
Hi all,
I am having a problem with bellow SOQL.
SELECT Name, (SELECT Name FROM Resource__r) FROM Projects__c

My Resource__c object has a lookup field for Projects__c. When i try to execute the Query it will throw me an error informing

"ERROR at Row:1:Column:36
Didn't understand relationship 'Resource__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names."

Please help me to resolve this. Also any material to understand the Related objects SOQL will be greately helpful for me to enhance my knowledge.

Thanks in advance. 
Hi All,
I am trying to impliment the bellow using forumla.
If(TODAY() > (StartDate + (Today -StartDate), 1, 0)
Ex: Today:21/Feb/2015
Start Date:21/Jan/2014
Formula: 21/Feb/2015 > (21/Jan/2014 + ( 1 ) )


Note: In above (Today -StartDate) will give me the Number of Years difference between the two.

How can i write a forumla for this senario?
Hi All,
Bellow is my part of VF source code. This is for a row delete button.
<apex:column>
<apex:commandlink  action="{!Deleterow}" immediate="true"><apex:param name="tentryid" value="{!Project.Id}"/><apex:param name="rowNumber" value="{!rowNum}"/><apex:commandbutton value="Delete" /> </apex:commandlink>
</apex:column>

and the corresponding Delete methode is as bellow.
public void Deleterow(){
String rownumber = System.currentPagereference().getParameters().get('rownumber');
Decimal rownumb = Decimal.Valueof(rownumber);
Integer rowno = rownumb.IntValue();
        if (rownumber != ' '){
            system.debug('This is the record' + rownumber);
        tentries.remove(rowno);
        UPSERT tentries;
        }
    }

But its not deleting the records from the row. Any suggestions plz!
Hi All,
What is the best cost affective way to get the gmail contacts into Salesforce contact ?

Thanks in advance :)

Regards,
Avi
Hi All,
Can any one suggest me some resource to get start with the Salesforce integration ?

Thanks in advance.

 
Hi,
I am a beginer to Salesforce platform. Can anyone please suggest me some good sample application which i can try by myself to explore the platform. I have tried recruiting app. 

Thanks in advance.
Hi all,
I am having a problem with bellow SOQL.
SELECT Name, (SELECT Name FROM Resource__r) FROM Projects__c

My Resource__c object has a lookup field for Projects__c. When i try to execute the Query it will throw me an error informing

"ERROR at Row:1:Column:36
Didn't understand relationship 'Resource__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names."

Please help me to resolve this. Also any material to understand the Related objects SOQL will be greately helpful for me to enhance my knowledge.

Thanks in advance. 
Hi All i am trying to build a simple page where i list all the item avialbe, and next to each item there will be button to show a description of the item. When user press description button bellow the item descriptions should be display. Items and Descriptions are from different objects they are related by lookup (dont want Master child relation).

I am facing few issues.
1. How can i acheave the fuction when user press detail button, details are displayed.
2. Since Item and desciptions are related i tried joined SOQL to retrive the data from both the tables but i am not able to disply the Description object records.
(Note: Bellow code i replaced all the name of the Item object with Projec__c and Detail with Resource__c)
 
<apex:page controller="Main_Timesheet" sidebar="false" action="{!onloadfunction}">
     <apex:variable var="rownum" value="{!0}" />
    <apex:form >
        
      <apex:actionRegion >
             <apex:actionSupport event="onchange" reRender="entrytable"/>
            <apex:outputPanel id="entrytable" rendered="{!NOT(ISNULL(entrylist))}">
                 
                <apex:dataTable cellspacing="15" value="{!entrylist}" var="Project">                 
                    <apex:column >
                        <apex:variable var="rownum" value="{!rownum + 1}"/> 
                        <apex:outputText >
                        {!rownum}
                        </apex:outputText>
                    </apex:column>
                     <apex:column headervalue="QB#">
                <apex:inputfield value="{!Project.QB__c}" style="width:100px;" required="true" rendered="{!(ISNULL(Project.QB__c))}"/>
                <apex:outputfield value="{!Project.QB__c}" style="width:1300px;" /> 
                         
                    </apex:column>
				
                 
                 <apex:column headervalue="Project Desc">
                <apex:inputfield value="{!Project.Description__c}" style="width:100px;" required="true" rendered="{!(ISNULL(Project.Description__c))}"/>
                   <apex:outputfield value="{!Project.Description__c}" style="width:300px;"/>  
                    </apex:column>
                   
                 
                 <apex:column headervalue="Delivery Date">
                <apex:inputfield value="{!Project.Delivery_Date__c}" style="width:100px;" required="true" rendered="{!(ISNULL(Project.Delivery_Date__c))}" />
                    <apex:outputfield value="{!Project.Delivery_Date__c}" style="width:300px;"/>
                    </apex:column>
                 <apex:column >
                 <apex:commandlink action="{!Deleterow}" immediate="true"> <apex:param name="tentryid" value="{!Project.Id}"/> <apex:param name="rownumber" value="{!rownum}"/><apex:commandbutton value="Delete" /> </apex:commandlink>
                 </apex:column>
                    
               </apex:dataTable>
                     
                    </apex:outputPanel>
         
           
            <apex:commandButton value="Create New" action="{!CreateNew}"/>
          <apex:commandButton value="Save" action="{!Save}"/>
        </apex:actionRegion>
    </apex:form> 
</apex:page>
 
public class Main_Timesheet {
   // Public List<Projects__c> tentries;
   Public List<SObject> tentries;
	public Projects__c delattendeeList;
    Public List<Resource__c> ResourceList;


    public void onloadfunction(){
      //tentries = [select Id,QB__c,Description__c,Delivery_Date__c from Projects__c];
        tentries =  [SELECT Id, Name,QB__c,Description__c,Delivery_Date__c, (SELECT Project_Name__c FROM Resources__r) FROM Projects__c];
    }            

    public List<Projects__c> getentrylist(){
    if (tentries!=NULL && tentries.size()>0) 
       return tentries;
    else 
       return null;       
	}


// Create a new Project record.    
    Public void CreateNew(){
        system.debug('Add new project');
        Projects__c newProject = new Projects__c();
        tentries.add(newProject);
    }
    

    public PageReference save(){
        UPSERT tentries;
        return null;
    }    
    
     public PageReference Deleterow(){
     	Integer rowno  = Integer.valueOf(ApexPages.currentPage().getParameters().get('rownumber'));
		//delattendeeList = tentries.get(rowno-1);
		tentries.remove(rowno-1);
		UPSERT tentries;
        return null;
    }    
}

Though i am using "
tentries = [SELECT Id, Name,QB__c,Description__c,Delivery_Date__c, (SELECT Project_Name__c FROM Resources__r) FROM Projects__c];" i am not able to disply "Project_Name__c"

Thanks for your wonderful suggetions :) 
Hi all,
I am having a problem with bellow SOQL.
SELECT Name, (SELECT Name FROM Resource__r) FROM Projects__c

My Resource__c object has a lookup field for Projects__c. When i try to execute the Query it will throw me an error informing

"ERROR at Row:1:Column:36
Didn't understand relationship 'Resource__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names."

Please help me to resolve this. Also any material to understand the Related objects SOQL will be greately helpful for me to enhance my knowledge.

Thanks in advance. 
Hi All,
I am trying to impliment the bellow using forumla.
If(TODAY() > (StartDate + (Today -StartDate), 1, 0)
Ex: Today:21/Feb/2015
Start Date:21/Jan/2014
Formula: 21/Feb/2015 > (21/Jan/2014 + ( 1 ) )


Note: In above (Today -StartDate) will give me the Number of Years difference between the two.

How can i write a forumla for this senario?
Hi All,
Bellow is my part of VF source code. This is for a row delete button.
<apex:column>
<apex:commandlink  action="{!Deleterow}" immediate="true"><apex:param name="tentryid" value="{!Project.Id}"/><apex:param name="rowNumber" value="{!rowNum}"/><apex:commandbutton value="Delete" /> </apex:commandlink>
</apex:column>

and the corresponding Delete methode is as bellow.
public void Deleterow(){
String rownumber = System.currentPagereference().getParameters().get('rownumber');
Decimal rownumb = Decimal.Valueof(rownumber);
Integer rowno = rownumb.IntValue();
        if (rownumber != ' '){
            system.debug('This is the record' + rownumber);
        tentries.remove(rowno);
        UPSERT tentries;
        }
    }

But its not deleting the records from the row. Any suggestions plz!
Hi,
I am a beginer to Salesforce platform. Can anyone please suggest me some good sample application which i can try by myself to explore the platform. I have tried recruiting app. 

Thanks in advance.