function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bonny mankotiabonny mankotia 

Update Exisiting File Reocrds.

Hi i have Custom Visualforce page "Registration" on which whenever i insert the record through page its create new file in Document object and enter the record values on that file I need a functionality that insert the record in same file instead of creating a new file whenever user create a new record TIA

public with sharing class Registration {
public string name{get;set;}
public string pass{get;set;}
public string age{get;set;}
public string mail{get;set;}
public Registration(String name,string pass,string age,string mail) {
this.name = name;
this.pass = pass;
this.age = age;
this.mail = mail; }
public Registration() { }
public pagereference save() { return null; }
public PageReference reset() {
PageReference newpage = new PageReference(System.currentPageReference().getURL());
newpage.getParameters().clear();
newpage.setRedirect(true); return newpage; }
public PageReference Store() {
Document d = new Document();
d.FolderId = UserInfo.getUserId();
d.Name = 'Data2';
String myContent = this.name+ '\n ' +this.pass+ '\n ' + this.age+ '\n ' +this.mail;
d.body= Blob.valueof(mycontent);
d.ContentType = 'text/plain';
d.Type = 'txt'; insert d;
return null; } }