• Anilt
  • NEWBIE
  • 99 Points
  • Member since 2012

  • Chatter
    Feed
  • 4
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 28
    Replies

Hi Everyone,

 

I think everyone is doing well.

 

Here is my code:

 

VisualForce Page:

 

<apex:page StandardController="Case" Extensions="ONEN_CTRL_WebToCase" action="{!submitCase}">
<apex:form >
<table>
<tr>
<th>Your Name:</th>
<td><apex:inputText value="{!Case.Account.Name}"/></td>
</tr>
<tr>
<th>Your Email:</th>
<td><apex:inputText value="{!Case.Contact.Email}"/></td>
</tr>
<tr>
<td align="right">
<apex:outputLabel value="Reason for Contact" for="txtPostalCode" styleClass="label" /><br/>
</td>
<td>
<apex:selectlist value="{!Case.Description}" id="txtPostalCode" styleclass="select">
<apex:selectOptions value="{!reason4Contact}"/>
</apex:selectlist>
</td>
</tr>
<tr>
<td><apex:commandButton value="Save" action="{!save}"/></td>
</tr>
</table>
</apex:form>

</apex:page>

 

Apex Code:

 

public class ONEN_CTRL_WebToCase1 {
Public Account Account {get; set;}
Public Contact Contact {get; set;}
Public Case cas {get; set;}
public List<SelectOption> getReason4Contact() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Select a Topic','Select a Topic'));
return options;
}
public PageReference save() {
return null;
}
public PageReference submitCase() {
Map<string,string> postParameters = ApexPages.currentPage().getParameters();
String LastName = ApexPages.currentPage().getParameters().get('Last_Name');
String Email = ApexPages.currentPage().getParameters().get('Email');
Account=New Account();
Contact=New Contact();
Cas=New Case();
If(Email==Contact.Email)
{

Cas.Account.name=Last_Name;
Cas.Contact.Email=Email;
}
insert Cas;
return null;
}
public ONEN_CTRL_WebToCase1(ApexPages.StandardController controller) {

}
}

 

Here my requirement is that if url parameter email='xxx@yyy.com' and Contact.Email='xxx@yyy.com' it must fetch Account.name and Contact.Email from contact and has to insert a record in the case.

 

Example

 

1. URL of the VFPage: \apex\VFPage?Last_Name='Anil'&Email='anil@talluri.com'

2. Contact.Email='anil@talluri.com'

 

3. In 2nd point, Contact.Email=Email

=> Fetch the account.name, contact.email from contact

 

4. Insert the record in case with the above account.name, contact.email

 

Please help me in implementing this. (I'm not at all satisfied with my code)

 

 

Hi Everyone,

 

I want to insert a record in Case with fields Name, Email.

 

I'm confused how to write SOQL query for retrieving the account name (=case name) and Contact Email (=case email).

 

Please help me in writing a SOQL query for this.

 

 

Hi Everyone,

 

I've a datetime field in 'Due_Date_Time__c' which will update another field "ReminderDateTime" with the following code (Subtracting 30 minutes from the Due_Date_Time__c).

 

Task t = new Task();
t.Subject='Send an Email';
t.Status= 'In Progress';
t.IsReminderSet= true;
t.priority='Normal';
t.Due_Date_Time__c=DateTime.Now().adddays(2);
t.Reminderdatetime=t.Due_Date_Time__c-(1/48); //formula to update reminderdatetime field
System.debug('Reminder Date Time is' + t.reminderdatetime);
System.debug('Due Date Time is' + t.Due_Date_Time__c);
database.insert(t);

 

So here the problem is I'm getting the reminderdatetime and due date time values as same.

Note: I want to integrate this in the clients website..So cant go for workflow.

 

Please help me where I'm doing wrong.

 

 

 

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

Hi I have Objects defined in XSD and i want to create an Object in salesforce. can any one suggest me an approach to do this.

Manually creating relation is tedious and error prone. i highly appreciate any inputs.

Thanks in advance.

 

further How should i represent 

<xs:complexType name="USPrice">
       <xs:sequence>
         <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/>
       </sequence>
     </xs:complexType>

in salesforce Object. further i got data in xml.

the Research i did is to develop using JPA App with java sdk and create Entity Class along with those relations. Wanted to know is that the right solution. or any other solution we have got to parse the xml records or create Objects.

 

Please Suggest.

Thanks in advance.

 

Hi Everyone,

 

I've tired on searching for a solution for a question "Downloading Attachments" in salesforce

 

I've searched for an article "Single button for downloading all the attachments".

 

FileExporter, JitterBit data loader, other apps like e-loader, Attachment Manager etc in AppExchange

 

Last but not least, I've gone for "downloadthemall" plugin in mozilla firefox

 

Nothing has helped me in downloading the attachments

 

Do anyone has other way for downloading the attachments?

Hi Everyone,

 

I want to display custom Exception in the page, so written code like ths

 

VF Code:

 

<apex:page controller="AgeException">
<apex:form >
<apex:pageMessages />
<apex:pageBlock >
<apex:inputText value="{!age}"/>
<apex:commandButton value="Submit" action="{!submit}"/>
</apex:pageBlock>
</apex:form>
</apex:page>

 

ApexCode:

 

Public class AgeException extends Exception
{
Public integer age {get; set;}
Public Pagereference submit()
{
If(age<20 || age>100)
{
throw new AgeException('Invalid Age: Age must be between 20 and 100');
}
}
}

 

Error:

 

java.lang.ClassCastException: common.apex.runtime.impl.ExecutionException cannot be cast to common.apex.runtime.bytecode.BytecodeApexObject

 

Please help me regarding this.

 

2nd question:

 

FYI....I've tried the same code with few modifications for adding the error message in the page and succeded

 

VF Code is same as above and Apex code as stated below

 

Public class ageexc
{
Public integer age {get; set;}
Public void submit()
{
If(age<20 || age>100)
{
ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.WARNING, 'Invalid Age: Age must be between 20 and 100'));
}
}
}

 

Please let me know why is it working for adding error message and why is not working for adding Exception.

 

hi everyone,

 

I want to display username dynamically (something like "Welcome xxxxx") in the customer portal header, when a customer logged in. Please help me regarding this.

 

Note: I've gone through that and observed that header cannot be changed with VF and CSS, HTML doesnot support dynamic displaying of this username.

 

Hi,

 

I want to display customers profile in home tab when a customer logged in customer portal.

 

So, I've added the "Customer Portal Welcome" in home page layout, but it is showing as below.

 

 After clicking My Profile link, it is showing the profile page.

 

but I want to display the customer profile directly (without clicking that My Profile link in the welcome message box).

Hi Everyone,

 

I've gone through theoretically about Single Sign On (SSO) which has been defined as having single password for accessing the multiple organisations

 

I've enabled the SAML under single sign on settings in my developer login

 

I didnt have any practical knowledge about Single Sign On..I'm in confusion

 

So, Please let me know what to do after enabling the SAML in salesforce.

 

Note: I have gone through several articles like salesforce single sign on implementation guide, wikipedia, youtube, communities etc. but still not able to know what to do after enabling the SAML in salesforce.

My Requirement is to create

 

VF Page: PDF that should have Opportunity Name, Opportunity.Account Billing Address in the header, Body should have Table with Opportunity Products, Footer should have Organization details.

 

Button in the Opportunity view page that will open the above pdf (pdf will have the values of the above fields of each record).

 

I'm able to acheieve this, but still has a problem.

 

My Problem is few records are not displaying the details of opportunity name, account billing address (these records still has the opportunity name, Account billing address etc). Can anyone about this..like account has the content, opportunity has the content too, but not displaying the content.

Controller:

public class reqfields {

Registration__c c=new Registration__c();
Public ID idd {get; set;}
public Attachment attachment {
get {
if (attachment == null)
attachment = new Attachment();
return attachment;
}
set;
}
 public PageReference Save(){
insert c;
idd=c.id;
Attachment a = new Attachment(parentid = idd, name=attachment.name, body = attachment.body);
insert a;
return new ApexPages.StandardController(c).view();
}
public reqfields(ApexPages.StandardController Controller) {

}

}

 

Dont mind, I'm unable to provide in nice format...

 

but Plz let me know how to save the record along with the uploaded document.

 

Note: Record id is saving in custom field Name.