• 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 want to display the article rating stars available in salesforce articles in the customer portal...but didnt get any way to display them in customer portal in order to make customers to rate our articles.

 

As per the salesforce knowledge overview document....

 

Rating Articles: Internal app, Customer Portal, and partner portal users can rate articles on a scale of 1 to 5 stars and view the average rating for an article. Average ratings are not static. Every 15 days, if an article has not received a new vote, its average moves up or down according to a half-life calculation. This change ensures that over time, older or outdated articles don't maintain artificially high or low ratings compared to newer, more frequently used articles. Articles without recent votes trend towards an average rating of 3 stars. The Articles tab also allows users to compare the ratings for different articles and sort the list view according to highest or lowest rated articles.

 

I've done everything..like gone through the profile settings, user settings, provided additional permission sets..but still didnt work for me...

 

 

Note: I've used Public Knowledge Base App to display the articles in the customer portal..

 

They have provided a answer in the below link...http://success.salesforce.com/questionDetail?qId=a1X30000000IVX7EAO....PKB2 doesnot support this..but requirement is on my head. I want to display that at any cost.

 

So please someone help me in this regard and make me to display the article rating stars in the customer portal website.

 

 

 

  • November 30, 2012
  • Like
  • 0

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)

 

 

  • November 28, 2012
  • Like
  • 0

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.

 

 

  • November 26, 2012
  • Like
  • 0

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.

 

 

 

  • November 23, 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 all,

 

Do anyone have an idea of generating Java classes from XSD files?

After long research..I've gone through this link

http://theopentutorials.com/examples/java/jaxb/generate-java-class-from-xml-schema-in-eclipse-ide/

but author has mentioned about 3 jar files in the above link..Can anyone please let me know where do I find those 3 jar files?

I understood everything except that.

  • November 14, 2012
  • Like
  • 0

Hi all,

 

My client has provided me 17 xsd files, where I'm unaware of xsd programming which has made me to search for the application to generate an object (using the same xsd files) with few clicks (similar to xsdobjectgen.exe/xsdobjectgenerator.exe in dotnet) in salesforce.

 

So please let me know if at all we have any application for generating an object using xsd files in salesforce.

  • November 12, 2012
  • Like
  • 1

Hi all,

 

I've written code in which multi-picklist values has to save in the record. Can you please modify my code in such a way that it must save the values in the record

 

VisualForcePage Code:

 

<apex:page standardController="Registration__c" extensions="checkbox">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton action="{!Save}" value="Save"/>
<apex:commandButton action="{!Cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:inputtext value="{!Registration__c.Name}"/>
<apex:selectCheckboxes value="{!countries}">
<apex:selectOptions value="{!items}"/>
</apex:selectCheckboxes><br/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Apex Code:

 

public class checkbox {
registration__c reg {get; set;}
String[] countries = new String[]{};
String java{get; set;}
public String[] getCountries() {
return countries;
}

public void setCountries(String[] countries) {
this.countries = countries;
}
public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Java','Java'));
options.add(new SelectOption('php','php'));
options.add(new SelectOption('.net','.net'));
return options;
}
public checkbox(ApexPages.StandardController controller) {
}

}

 

 

  • November 08, 2012
  • Like
  • 0

Hi Everyone,

 

I'm in a great need where I dont want to show SalesForce url in Live chat Window (Clients website shows different url and live chat window shows SalesForce's URL which might make customers of my client to think that he is in different place)

 

Please let me know if atleast one of the assuming points shown below can be done. If yes, how is it possible?

 

1. I've tried to hide the address bar in the Live Agent Chat Window

 

2. Can I replace url with string ex: replacing "apex/chat_window" with "Live Agent Chat Window"

 

3. When customer clicks Chat Button, it has to open the salesforce chat window but has to to show my client's web page url

(I know it is not at all possible..but still having a chance to complete my task)

 

Note: I've gone through the window, location objects in Java Script  but still not succeeded.

 

 

  • November 07, 2012
  • Like
  • 0

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?

  • November 05, 2012
  • Like
  • 0

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.

 

  • October 31, 2012
  • Like
  • 0

Hi Everyone,

 

I'm trying to learn about server side exceptions

 

So, I've gone through the below link

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_exception_methods.htm

 

My doubt is, whether these exceptions mentioned in the above link and exceptions are same? different?

 

If these exceptions are different, please share some links/videos which can teach me better....if there are no links/videos then plz dont mind to paste it here your comments to make me know it better.

  • October 26, 2012
  • Like
  • 0

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.

 

  • October 25, 2012
  • Like
  • 0

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).

  • October 23, 2012
  • Like
  • 0

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.

  • October 19, 2012
  • Like
  • 0

Hi All,

 

I've setup the Email to case in my login, Created Routing Address and Added Email related list to the Case through Page Layout.

 

I've Sent few mails through Case and able to see the mails in the routed email address

 

So Question is that, Is this the case management through Email to Case?

 

I'm totally confused...whatz the use of email to case? Please let me know

 

 

  • October 09, 2012
  • Like
  • 0

I'm writing a trigger (with DML Operations provided in http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_database_dmloptions.htm) to check the 'Assign using active assignment rules' and 'Send notification email to contact' based on some conditions to work on Active Assignment Rule and Auto-Response Rule

 

Here is the Trigger based on the link provided above:

 

trigger AssignmentRule on Case (After Update, After Insert) {
for (Case c : System.Trigger.New) {
Database.DMLOptions dmo = new Database.DMLOptions();
If(c.Status=='New')
{
dmo.assignmentRuleHeader.useDefaultRule= true;
}
}
}

 

Please someone help me regarding this.

  • October 09, 2012
  • Like
  • 0

Hi All,

 

I'm new here...

 

We are heads up with a requirement where we need to use email templates for Case Management.

 

Can anyone share few scenarios where we use email templates to go automatically.

 

I dont want code and all...Just need few scenarios so that I want to create few email templates.

  • October 04, 2012
  • Like
  • 0

Hi all,

 

I'm getting below Error while installing Force.com IDE

 

 "A Java Runtime Environment (JRE) or Java Development Kit (JDK)

must be available in order to run Force.com-ide-installer. No Java virtual machine
was found after searching the following locations:
/home/salesforce4/Downloads/force.com-ide-installer-linux-gtk-x86/jre/bin/java
java in your current PATH"

 

Please let me know what to do now?

  • October 04, 2012
  • Like
  • 0

Hi all,

 

I'm getting below Error while installing Force.com IDE

 

 

 

"A Java Runtime Environment (JRE) or Java Development Kit (JDK)

must be available in order to run Force.com-ide-installer. No Java virtual machine
was found after searching the following locations:
/home/salesforce4/Downloads/force.com-ide-installer-linux-gtk-x86/jre/bin/java
java in your current PATH"

 

Please let me know what to do now?

  • October 04, 2012
  • Like
  • 0

Hi all,

 

My client has provided me 17 xsd files, where I'm unaware of xsd programming which has made me to search for the application to generate an object (using the same xsd files) with few clicks (similar to xsdobjectgen.exe/xsdobjectgenerator.exe in dotnet) in salesforce.

 

So please let me know if at all we have any application for generating an object using xsd files in salesforce.

  • November 12, 2012
  • Like
  • 1

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)

 

 

  • November 28, 2012
  • Like
  • 0

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.

 

 

  • November 26, 2012
  • Like
  • 0

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.

 

 

 

  • November 23, 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

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?

  • November 05, 2012
  • Like
  • 0

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.

 

  • October 31, 2012
  • Like
  • 0

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.

 

  • October 25, 2012
  • Like
  • 0

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).

  • October 23, 2012
  • Like
  • 0

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.

  • October 19, 2012
  • Like
  • 0

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.

  • October 01, 2012
  • Like
  • 0

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.

  • September 24, 2012
  • Like
  • 0