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
ram2forceram2force 

can I access Accounts object from my site....

can I access Accounts object from my site....

 

That is, I want to create the following in my Site.

Textbox for Account name,

ID Number Submit button

 

If i click on Submit from my site, A new Account will be created in salesforce Organisation Accounts Object with Account name, ID Number(I given in site).

 

Is it possible...if possible how to do this....

bob_buzzardbob_buzzard

Here's a simple example of how to do this.  My page just has the account name, but you can easily add some more fields.

 

Page:

 

 

<apex:page controller="CreateAccountController" sidebar="false" standardstylesheets="false"
    showheader="false">
<h1>Create Account</h1>
<apex:form >
<apex:inputText value="{!acc.name}"/><br/><br/>
<apex:commandButton action="{!Save}" value="save" />
</apex:form>
</apex:page>

 

 

Controller:

 

 

public  class CreateAccountController 
{
  public Account acc {get; set;}
  public CreateAccountController()
  {
    acc=new Account();
  }
  
  public void Save()
  {
    insert acc;
    acc=new Account();
  }
}

 

 

You'll need to add the visualforce page to the site.  if your site is available to unauthenticated users, you'll need to add the VF page to the guest user profile, reachable from the public access settings button.

 

ram2forceram2force

hi,

 

i have added Visual force page for my site...then how to give link to Visualforce page from the site. Always my home page is displayed in my site. From that home page, how to move to next page or a visualforce page.....

 

Normally while creating website we can create a hyperlink for the next page using url...here(force.com sites) how to move to next page or other visualforce page........

 

Plz help..........

new2forcenew2force

Hi, u just add  VF pages in the sites. Controller classes will be automatically fired or exceuted . links should be given using  PageReference object.

PageREference ref= new PageReefernce();

for example, if(condition)

{

    ref=new PageReference('/urpage');

}

 

else

ref=new PageReference('/urpage');

 

ram2forceram2force

Hi new2force,

 

     Where I want to add this coding.......I am not clear about creating site.....Please provide any procedure or tutorial or video link  to create a Site from beginning to end Clearly.............

new2forcenew2force

Go thru these pages, it may help u

 

http://wiki.developerforce.com/index.php/An_Introduction_to_Force.com_Sites

 

http://wiki.developerforce.com/index.php/Authenticating_Users_on_Force.com_Sites

 

http://wiki.developerforce.com/index.php/Delivering_Static_Resources_with_Visualforce

 

in case if u r new to creating VF pages, i suggest u to go thru HTML and CSS, javscript tutorials at w3schools.com . just have a glance .it will help u

ram2forceram2force

Hi new2force,

 

    Thank you for providing useful materials......Also I have another doubt.....

 

Consider I have completed developing my force.com site(Actually I am developing Custom site like ordinary websites).....Then how to give that website to others use(other organisation).....

 

That Organisation should have Salesforce Account.....Actually they didn't have any idea about salesforce......

 

Plz help.....

new2forcenew2force

hey i didnt get u what do u mean by other organization?  when u create a website and keep them in production too, thats enough everyone without any salesforce account can use sites. for example we can keep my company website in salesforce and provide that URL to everyone. they can login ,register ,etc. 

 

get back to me eloborating what do u mean by organization ?

ram2forceram2force

Actually I want to create a site for other Company....not for my company.....

bob_buzzardbob_buzzard

Depending on your edition you can create mutliple sites.  You can then point the other company at a different site to yours.

 

ram2forceram2force

Ok...I am developing in Developer Edition.....You know by Developer edition we can create only one site....

 

My doubt is, now i created a domain and site(in other comapny name) in developer Edition for free.

 

then i will give that url to that other company, they are not having any idea about salesforce and all.......

 

Simply they type url in browser and access the web application(like normal websites)......

 

My doubt is, they want to pay any money for using that site.....How long time they can access these for free???? ....this is my doubt for lon time..........

new2forcenew2force

even u develop for other company, then what. . u r developing for other company. its ok .they will give that URL to their users. in future if they need any changes , they will come to u. In ur case, it may be like u r hosting the website for them and ur company is charging them or u guys  may be providers having developers and developing for  customers .

 

In my case, before i am into my company(client), my client have their work done by some SFDC solution provider. they gave all pages ,triggers in packages and we have them in our SFDC account now. among those, I kept whatever i need in sites. thats it . we gave theURL to our users