• Gulshan__c
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
Hi,
I am fetching date using TODAY() function.Now i want to add another date in todays date.I am fetching the custom date from my custom object field.all this i need on VF page.

im using {!Today()} ---------------->for fetching todays date
{!obj.Custom_date} ---------------->Custom date

im trying to add like 
{!TODAY()}+{!obj.Custom_date__c}

Output receiving is as below

 2/8/2016+10/31/2015 2:59 PM




 
Hi getting the exception when trying to add records on my custom object Position__c

Here is my Controller :


public class InsertByVF{

    public Position__c pos;
    public String positionName{get;set;}
    public Decimal MinimumPay{get;set;}
    public Decimal MaximumPay{get;set;}
    
    public InsertByVF()
    {
    pos=new Position__c();
    
    }
  
    public void doInsert()
    {
 
    pos.Name=positionName;
    pos.Max_Pay__c=MaximumPay;
    pos.Min_Pay__c=MinimumPay;
       
  insert pos;      
       
 }
}


And below is my Apex page code :

<apex:page controller="InsertByVF">
<apex:form >
<apex:pageBlock title="New Position">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel >Position Name :</apex:outputLabel>
<apex:inputField id="FirstName" value="{!Position__c.positionName}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Max Pay :</apex:outputLabel>
<apex:inputField id="MaxPay" value="{!Position__c.MaximumPay}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Min Pay :</apex:outputLabel>
<apex:inputField id="MinPay" value="{!Position__c.MinimumPay}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton id="Save" action="{!doInsert}" value="Save"/>
<!--<apex:commandButton id="Cancel" action="{!Cancel}" value="Cancel"/>-->
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
 
Hi,
I am fetching date using TODAY() function.Now i want to add another date in todays date.I am fetching the custom date from my custom object field.all this i need on VF page.

im using {!Today()} ---------------->for fetching todays date
{!obj.Custom_date} ---------------->Custom date

im trying to add like 
{!TODAY()}+{!obj.Custom_date__c}

Output receiving is as below

 2/8/2016+10/31/2015 2:59 PM




 
Hi getting the exception when trying to add records on my custom object Position__c

Here is my Controller :


public class InsertByVF{

    public Position__c pos;
    public String positionName{get;set;}
    public Decimal MinimumPay{get;set;}
    public Decimal MaximumPay{get;set;}
    
    public InsertByVF()
    {
    pos=new Position__c();
    
    }
  
    public void doInsert()
    {
 
    pos.Name=positionName;
    pos.Max_Pay__c=MaximumPay;
    pos.Min_Pay__c=MinimumPay;
       
  insert pos;      
       
 }
}


And below is my Apex page code :

<apex:page controller="InsertByVF">
<apex:form >
<apex:pageBlock title="New Position">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel >Position Name :</apex:outputLabel>
<apex:inputField id="FirstName" value="{!Position__c.positionName}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Max Pay :</apex:outputLabel>
<apex:inputField id="MaxPay" value="{!Position__c.MaximumPay}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Min Pay :</apex:outputLabel>
<apex:inputField id="MinPay" value="{!Position__c.MinimumPay}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton id="Save" action="{!doInsert}" value="Save"/>
<!--<apex:commandButton id="Cancel" action="{!Cancel}" value="Cancel"/>-->
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>