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
XXXXXX 

How can the application create records automatically?

We are working on an application for the AppExchange that needs certain default data to exist either when it gets installed or when it runs for the first time.

 

How can we do this?

 

TIA,

 

John

wesnoltewesnolte

Hey

 

You'll have to use the ApexDataloader.

 

Cheers,

Wes 

XXXXXX

This is just a theory at present but this is what I have so far:

 

1. Create a "Welcome" page, you know, the page that shows up one-time-only and explains how the application works. Link this page to another page on the application, so that when THAT page is shown, the Welcome page shows up first.

 

2. This is a VF page, and in the constructor of that page, check for and, if missing, create the necessary system data.

 

3. Make the linked page the default page for the application. Wheneverany user runs the application, the system data will be created. Of course, the system data will only be created once because we will test to see if it exists yet. This does mean that we do an extra check the first time ANY user runs the application, but that's a small price to pay to have system data created automatically "on install".

 

What do you think?