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
AndyPandyAndyPandy 

VF Page Process for Custom Object

Hi All,

 

I'm a fairly confident Admin of my SFDC Org, with regards standard functionality, but completely new to coding, APEX and Visualforce (having made only a couple of very simple VF Pages, and no Custom Triggers).

 

However, I have recently put together a new Custom Object, which allows our users to create Deals (very much like the standard Opportunities object - but we needed a Custom version - don't ask...).

 

We need to tweak this slightly - so that it works a bit like this:

 

- User selects the "Deals" tab from within SFDC Org

 

- They press the standard "New" button, to create a new deal

 

- They then have to choose one of two Record Types ("Cameras" or "Other")

 

- If they choose Other - then it opens a standard Page Layout, with the Custom Fields created in relation to the Custom Object, which allows them to save a record using the standard "Save" button - all completely standard and generic, no problem.

 

- If they choose Cameras - then I need something a bit different to happen; firstly, I will still need a very similar standard Page Layout to the "Other" option as above, but with a few different fields, but instead of having the normal "Save" button at the bottom of the page, I want this page to be step 1 of 3, and there to be a button called "Next" at the bottom.

 

- Once they've hit "Next", it takes them to a booking form (another page layout), which allows the user to select from a range of DEMO equipment, which they wish to order. Once they've entered the details of the equipment they want, there is another "Next" button to get to step 3.  However, as this DEMO equipment is optional, I also want a button available which says "Skip This Step" - which takes them to Step 3 without completing a Booking Form.

 

- Step 3 will then just be a "Save" button to complete the process.

 

I am absolutely fine with doing everything up to the "Steps" process of the Cameras record type option - which is where I have no idea if that is possible.

 

Also - just to add ALL the information, if someone does choose Cameras and fills in a DEMO equipment booking form in Step 2 - I would like a Workflow to email the details of that record to another user - who will then process the DEMO equipment order.

 

Can anyone let me know if this is possible at all, and if so point me in the direction of where I can get help (and perhaps what the technical name for this process type thing I am trying to achieve is called, so I can do some more research) - I have tried a number of search terms, but have not yet found what I need...

 

Thank you very much indeed (and please let me know if I can provide any further details to help!).

 

Thanks again,

 

Andy

bob_buzzardbob_buzzard

This sounds like you are looking for a wizard - in that case the same controller instance is managing several pages and maintaining the data collected across those pages until its time to save.  In terms of hitting pages based on the record type, the standard technique is to override the create with your visualforce page, and then inspect the record type on the URL and send the user to the standard page if appropriate.

 

The visualforce developer's guide has an example of developing a wizard at:

 

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=pages_quick_start_wizard.htm|StartTopic=Content%2Fpages_quick_start_wizard.htm|SkinName=webhelp

 

There's an example of overriding for a single record type at:

 

http://boards.developerforce.com/t5/Visualforce-Development/Override-New-for-Single-Record-Type/td-p/77918

 

AndyPandyAndyPandy

Hi Bob,

 

That's great, thank you for your help...

 

I think I'll have to do a lot of reading and testing, but this information looks a lot like what I'm after.

 

Thanks again,

 

Andy

nyhansanyhansa

Hi Bob,

 

I used the example you posted (Override New for Single Record Type) and am having an issue with the redirect. I'm overriding the Account 'New' button to send my users to a custom Person Account Edit page, but would like to have them continue on to the standard Edit page for all other Record Types. Even though I included the nooverride=1 tag, I'm always redirected to the Person Account Edit page, regardless of what record type I select. Is there another way to prevent the override? Let me know if you need me to post my code.

 

Thank you so much!

 

Sam

bob_buzzardbob_buzzard

Are you passing the record type information on the URL in the same way that the standard functionality does?