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
Ryan M.ax204Ryan M.ax204 

Use of custom objects

Hi folks - I have created several custom objects but have some outstanding questions. Here's a simple example. I create an object called "ComputerType". I create fields called UserId and ComputerType. The intent would be to use the SF userid as the primary key for this table and the ComputerType field to store what kind of computer that user has (model number or whatever).

So then along with these two fields, I'd get the standard "Id" and "Name " fields created. I know the Id field is normally the primary key for an object, but in this case, I'd want to use UserId field. Is this a good approach? Basically ignoring the Id and Name and just using my custom fields?

So if I wanted to do an upsert, could I use the UserId as the lookup field?

I should mention that these objects will be manipulated by my app only and not used anywhere in the SF layouts so I don't nee any of that functionality.

Ryan

Message Edited by Ryan M on 04-04-2006 10:16 AM

darozdaroz
If your PK is going to be the UserID, why not just add a custom field (ComputerType) to the User object instead? Now granted, you can't stop your users from seeing it or editing it there, but it might be a while lot easier?

If that's not possible, you'll need to create your object w/ a lookup reference (can't do Parent/Child to User last I checked). and the object will ahve a native SFDC ID field and Name field with it. (You can make the name field an autonumber and ignore it from there on out if you want. I suggest you put a prefix on it tho as not to confuse it with any other autonumbers...)