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
hoagieryderhoagieryder 

Custom Object or Visualforce Page?

I am trying to add a survey that is attached to Accounts. Ideally what I wanted to do is have a button on the Account page, that when clicked will open up either a custom object or Visualforce page that has a brief survey regarding that Account (fields: Date, Account Rating). There would also be a submit button, that when clicked would save the account id, date,account rating to the database. Can this be done with Salesforce, and if so what route should I go in, Custom Object of Visualforce Page?

hisrinuhisrinu

If you just wanted to configuration then all you need to do is just create a custom object with the required fields (one field being is lookup/master-detail to account). When you form this relationship you will be able to see this object in the related list from this user can click on new button and enter the rating and click on save.

 

 

If you want to provide only on the account detail page as a popup then you might need to go to visualforce page

seahorceseahorce

Keep in mind that even if you provide a Visualforce page, that data has to be stored on an object.  Since you will most likely have multiple surveys, I'd think you would want to create a custom survey object to be a child of the Account.  That way you can see the multiple responses in the Account related list as the other contributor suggested.

 

There are some decent (& free) survey apps on the AppExchange that you might want to check out instead of creating one yourself.

hoagieryderhoagieryder

It appears as though the custom object route will definitely work. My only hangup is the Name field for the custom object. It either has to be entered by the user, or is an autonumber.  I want the name to be the Date, and the only way I can do that is if the user enters it. Is there anyway around this?

hisrinuhisrinu

In the auto number also you can give the date format something like below

 

{DD}{YYYY}{MM}-0

seahorceseahorce

I think you could make it a text field and populate the date as text within the Visualforce page code.

EIE50EIE50

Hi,

 

Adding up with srini's response,

 

 the format has to be {MM}{DD}{YYYY}-{0} (a typo in srini's response)

or even you can use this format, {MM}-{DD}-{YYYY}-{0} or {MM}/{DD}/{YYYY}-{0}.

 

 

Thanks.

hoagieryderhoagieryder

I have actually decided to go with a visual force page because the survey requires radio buttons, which from what I understand are not available as a standard salesforce field. I am going to store the data from the survey within a custom object I will call PAR. I am new to visualforce so I would like any recommendations on where to start. This is how I would like the page to work:

 

A custom link within the Account. When the link is clicked a screen appears with a relatedlist for custom object PAR. I would like to be able to include what fields I like in this list, only the field "As of Date". A user would be allowed to either edit or add a new PAR. If they add I would then have a different form that would have a number of input fields and the radio buttons like I discussed earlier. A user would then be able to save this form to the PAR object.  

 

I essentially want everything to work just like a customobject with a master relationship with Accounts, except with two differences. The fields listed when opened would only include As of Date, not Account Name; and radio buttons would be used instead of drop down boxes.

 

Does this sound doable?