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
j_glassj_glass 

Newbie questions - pointers to info appreciated


Hi all,

I'm a newbie here, though a fairly experienced programmer.
My company is planning to develop a force.com composite application that includes
custom tabs, custom objects with related 'business logic' which makes
outbound webservice calls, and triggers on multiple objects (e.g,
Opportunity, Case, as well as our custom objects). The technical stuff looks
straight forward - APEX seems be a really well-put-together platform, but
there are still some gaps in my understanding on some of the non-technical stuff (packaging,
the fee model, etc.). If there are docs that describe these, I'd really appreciate pointers to them.

Here goes. Some of the questions may be pretty basic, so pardon my ignorance.

1. Once I've packaged my app and registered it on AppExchange, when an admin
user installs the app for everyone in an organization, will the install
process also install the triggers for each user?
2. If my application requires triggers to be created selectively for certain
objects (e.g., if user has a certain report, then create a trigger for
object type X else create trigger for object type Y), or for all objects
(i.e., install triggers for all objects in all applications that the current
user has), is there a way my app can get control during install and create
triggers programmatically?
3. From my database experiences, I know that triggers make things slow, so
are there best practices for using triggers, especially for multiple
objects?
4. Once I develop the app, how long can it remain in force.com (using up
database space, etc.) before it needs to be registered with AppExchange (or
deleted)?
5. The registration process includes certification by the force.com folks to
make sure it is kosher and to attach a license manager to it to track its
installations.  With the Winter 08 release, I believe it is also possible to
upload an app to AppExchange but not register it (the app will remain
unlisted and won't show up in AppExchange, but I can email the url to
individuals for them to try it out). What are the pros and cons of both
approaches? In the latter case, does it simply mean I won't be notified when
the app is installed? Are there other drawbacks? Are there fee differences
between the two (I mean the subscription fee, not the certification fee)?

Thanks in advance.

wilbur07wilbur07
1.  Yes.

2.  No.  You should note that triggers occur on before and after inserts, updates and deletes on a given object regardless of the user, so installing a trigger on an object installs it for all users.  There is a way to get the trigger to fire depending on the user by coding for whatever distinguishing field the object has, someting like if ContactId is in [select Id from Contact where lastname='johnson'] then run the trigger code would distinguish possibly the user.  There is no way in salesforce to distinguish trigger usage by user, a trigger acts on all events that trigger it.

3.  You should learn how to do bulk triggers as there is an execution limit of 20 dml statements per trigger.

4.  Salesforce.com seems to have plenty of room for everybody's apps so don't worry about leaving one lying around.

5.  It's your call on whether you want to register your apps.  I usually don't because i'm not prepared for supporting my app when I publish it!  I generally write a package for one customer only and deploy using Force.com IDE not by package.

hope this helps.

James