• PeterUchytil.ax224
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I have read through the Apex language guide and this post discussing the upsert feature, but I'm still confused as to whether I can do what I want.

I have a sign-up process that I'm integrating with Salesforce. First in the process a survey is given. I will store this a custom object. Later in the process the Account is created and I want to link it to the Survey, but due to some timing issues, I can't guarantee that the Survey object will actually get created before I try to create the Account. I'm guessing most of the time it will, but I can't be sure.

What I want to do is create the Survey object and give it an ID that I create. This is set as an External ID. Then I have an External ID in the Account object. When I create the Account, I wanted to do it with an upsert command to link together the Survey and the Account by the External ID. I tried this, but I the relationship never gets made.

I set my objects up like this:

Survey
    Text SurveyID (External ID)

Account
    Text SurveyID (External ID)
    Related Field: Survey

As a test I created a Survey and set the SurveyID to '1234' then I did this upsert:

Account a;
// set up the account
a.SurveyID = '1234';
upsert a Survey__c.SurveyID;

I was hoping that would fill in the Survey related field in the Account.

I'm obviously doing something wrong. Is what I'm describing even possible? The blog post seemed to indicate it was.

Thanks for any help you can give.

Peter
Sorry, newbie question here: I have been able to create an Apex trigger using the Eclipse Force IDE, but when I go to Salesforce and click the Active checkbox, I can no longer save using Eclipse. I get an error about a conflict due to a user update on Salesforce and I should use the Synchronize Perspective to solve the problem. I open the Synchronize Perspective in Eclipse, but there's nothing in the pane. I don't see a way to synchronize the files.

Any ideas? Thanks.

Peter
Sorry, newbie question here: I have been able to create an Apex trigger using the Eclipse Force IDE, but when I go to Salesforce and click the Active checkbox, I can no longer save using Eclipse. I get an error about a conflict due to a user update on Salesforce and I should use the Synchronize Perspective to solve the problem. I open the Synchronize Perspective in Eclipse, but there's nothing in the pane. I don't see a way to synchronize the files.

Any ideas? Thanks.

Peter
I would like to have a lookup field instead of a text box on my opportunity wizard.
 
What control should be used to lookup vs. inputText?
 
Thanks