• Tanay
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies

I have two Object Project & Milestone in M-D relationship. Project  object has Project_Start_Date__c and Project_End_Date__c   &In  Milestone Object has Milestone_Start_Date__c & Milestone_End_Date__c.

 

Now , I want  a validation rule , Where Milestone_Start_Date__c & MileStone_End_Date__c  value should be always In Between Project start & End date.


I Try the code below , But didn't work.:(

 

 

Milestone_Start_Date__c  >=   Project__r.Project_Start_Date__c   &&   Milestone_End_Date__c  <=  Project__r.Project_End_Date__c 

 

 

 

Thanks In advance!! :-)

  • November 19, 2012
  • Like
  • 0

Hi Everyone,

 

Code is as below:

 

<apex:page controller="lead_urlparameters">
<apex:form >
<apex:inputText value="{!Organization}" rendered="false"/>
<table >
<tr><td><apex:outputLabel value="Your Name"/><br/>
<apex:inputtext value="{!yourname}" label="Your Name"/></td></tr>
<tr><td><apex:outputLabel value="Your Email"/><br/>
<apex:inputtext value="{!youremail}" label="Your Email"/></td></tr>
<tr><td><apex:outputLabel value="Reason for Contact"><br/>
<apex:selectList value="{!Reason4Contact}" label="Reason for Contact">
<apex:selectOptions value="{!Reasons}"/>
</apex:selectList>
</apex:outputLabel><br/></td></tr>
</table>
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:form>
</apex:page>

 

Apex:

 

global with sharing class lead_urlparameters {

Lead newLead = new Lead();
String[] Reason4Contact = new String[]{};
public String youremail { get; set; }
public String yourname { get; set; }
Public String Organization { get; set; }
Public lead_urlparameters(){
Map<string,string> urlparameters = ApexPages.currentPage().getParameters();

if (!urlparameters.isEmpty()) {
newLead.Email = ApexPages.currentPage().getParameters().get('Email');
newLead.Description = ApexPages.currentPage().getParameters().get('Reason4Contact');

}
}

public PageReference cancel() {
return null;
}

public PageReference save() {
if (ApexPages.currentPage().getParameters().get('Organization')==null || ApexPages.currentPage().getParameters().get('Organization')=='') {
newLead.Company = 'PopcornApps';
}
if (ApexPages.currentPage().getParameters().get('yourname')==null || ApexPages.currentPage().getParameters().get('yourname')=='') {
newLead.LastName = '[not provided]';
} else {
newLead.LastName = ApexPages.currentPage().getParameters().get('yourname');
}
PageReference pageRef = new PageReference('http://www.google.com');
return pageRef;
}
public List<SelectOption> getReasons() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Select a Topic','Select a Topic'));
return options;
}

public String[] getReason4Contact() {
return Reason4Contact;
}
public void setReason4Contact(String[] Reason4Contact) {
this.Reason4Contact = Reason4Contact;
}
}

 

My Requirement is to pass the field values in url like

vfpage url is enclosed within these brackets

 

na1.salesforce.com\apex\vfpagename?name='xxxx'&email='xx@xxx.com which must insert a lead with these values.

 

there are no exceptions, but not able to insert the records with those values.

 

Please help me

 

 

  • November 19, 2012
  • Like
  • 0

Hi,

 

How to convert this string in to date. Please help me its very urgent.

 

Tue Nov 06 00:00:00 GMT 2012

 

Thanks,

Lakshmi

I have two Object Project & Milestone in M-D relationship. Project  object has Project_Start_Date__c and Project_End_Date__c   &In  Milestone Object has Milestone_Start_Date__c & Milestone_End_Date__c.

 

Now , I want  a validation rule , Where Milestone_Start_Date__c & MileStone_End_Date__c  value should be always In Between Project start & End date.


I Try the code below , But didn't work.:(

 

 

Milestone_Start_Date__c  >=   Project__r.Project_Start_Date__c   &&   Milestone_End_Date__c  <=  Project__r.Project_End_Date__c 

 

 

 

Thanks In advance!! :-)

  • November 19, 2012
  • Like
  • 0