• wilbur07
  • NEWBIE
  • 5 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 21
    Replies

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.

How does one go about segregating value add in Apex/package based environment?

Here is my issue:

Let's say i define a custom object called Foo with attributes A,B,C,D.along with related business logic etc...

I package this as a "Foo package"  and sell it as Foo Application.

I now want to build another application with object Zoo with it's own attributes.

However, Foo is related to Zoo and actually has a lookup field to Zoo!  The moment, I add "Zoo" as a lookup field, to Foo,  system automatically includes Zoo in the "Foo Package". Once Zoo is included, all the objects get pulled it and the whole thing becomes a mess - there is no way to disallow access to users once Zoo is installed.

Are there any suggestions/workarounds?





Hi all:
   I am using an Integration Tool to upload data into the products2 and pricebookEntry table... Now, I can load data into the product2 table no issues there. But when I try to load the pricebookentry to link back to product2Is and pricebook2Id.. the issue I have having is "[SFDC] No standard price defined for this product    [SFDC] STANDARD_PRICE_NOT_DEFINED"
Ok Now I know that standard price is the default unit price if you go through the excel connector in a Product table...
But how do you fill it through an API when it is not part of the product2 table???
Any help ... Please Advise...
Thanks
Shan
I think I found a nasty bug in salesforce.

I created AssetHistory object which is supposed to be a replica of CaseHistory object only tracks Asset changes.
When creating the trigger to make the system work I could not assign any values to AssetHistory__c.Asset__r!!!!

Unlike Contact.AccountID which is used to assign a parent Account ID to a contact, I could not assign a value to AssetHistory.AssetID which is an invalid field or any other iteration of the same, Asset__r.Id is not writeable, Asset.ID does
not work, Asset__r= [select id from Asset where id = 'somevalidAssetID'] does not work!!!!!!

None of the Asset references to ID or the sObject Asset instances are stored when I assign Asset__r = <some valid Asset> and then insert the new AssetHistory__c record!!!!!

This has got to be a bug!

Any help of course would be appreciated.

James
I have a trigger on Asset that writes AssetHistory much like CaseHistory tracks changes in Cases.

I am having trouble assigning a value to the parent field Asset__r.  When I assign Asset__r.Id to a trigger value it says that field is not writeable.  If I assign Asset object from trigger (say Asset a : trigger new) Asset__r=a; then nothing gets written to that field on the trigger event, and the asset history item does not show on related list under the Asset. 

Please tell me a way to assign the correct Asset value, whether Id or Name or what, to the parent field AssetHistory__c.Asset__r field and I will be forever in debt to you.

James
I have this code which gives an error when I try to compile my trigger:

for (Asset a : Trigger.new) {
    if (Trigger.isInsert) {
        AssetHistory__c nli0 = new AssetHistory__c();
        nli0.Name='Created';
        nli0.Asset__r.Id=a.Id;
        insert nli0;
    }
    else {

the error is Error: Compile Error: Field is not writeable: Asset__r.Id at line 8 column 9

I tried this replacement which compiles but does not assign any value to the parent field Asset__r when the trigger executes.

nli0.Asset__r=a;

and these lines all give cannot write errors, or field not in AssetHistory__c object:

nli0.Asset__rId = a.Id;
nli0.AssetId = a.Id;

My question is, how do I assign a parent Asset to my AssetHistory__c objects?

Any help is appreciated.
I'm having trouble deploying to a regular organization (not developer or sandbox).
 
Here is the apex code:
 
trigger AutoPopulatePricebookEntry on Product2 (after insert) {
 
 sObject s = [select ID from Pricebook2 where IsStandard = TRUE];
 
 for (Product2 newProduct: Trigger.new) {
  
  PricebookEntry z = new PricebookEntry(Pricebook2Id=s.ID, Product2Id=newProduct.ID, UnitPrice=0.00, IsActive=TRUE, UseStandardPrice=FALSE);
  insert z;
  
 }
}
 
Here is my testcode that I ran all tests on and succeeded:
 
public class myClass {
  static testMethod void testInsertLine() {
   Product2 p = new product2(name='x');
   
   try{
    insert p;
                }
          catch (DmlException e) {
            System.debug(e.getMessage());
                }
   
   System.assertEquals(0.00, [select UnitPrice from PricebookEntry
                               where product2id = :p.id].UnitPrice);
  }
 }
 
When I try to deploy the Eclipse message is that all 4 lines of my code are uncovered.
 
HEEEELLLLLPPPPP!!!!!  Several hours of frustration lead me to beg someone's knowledge and wisdom.  Perhaps some sample code showing me how to cover each line in my trigger?  Thanks in advance!
 
James
How do you modify [add] related lists?
Hi!  I'm new to salesforce, and I have a question or call for an example to help get me started.
 
I need to write an Apex trigger that captures when a new product is created and then writes in an entry in the pricebook of 0.00 for that product.
 
Any help would be appreciated.