• OCDGeek
  • NEWBIE
  • 5 Points
  • Member since 2008

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

Is there a way you can create/set the Id field of a new SObject before performing an insert DML statement?

 

I know you can set it to an existing Id like this:

 

SObject s = Database.query('Select Id from account limit 1')[0].getSObjectType().newSObject([SELECT Id FROM Account LIMIT 1][0].id);

 

 

But is there a way to set it for a newly created SObject?

 

I need to create a few objects, retrieve their Ids and then send them to another system via a web service callout. I cannot issue a web service callout after the DML statement (without using @future call), so I'm trying to get the Ids and send them before actually making the insert DML statements

 

Any help would be appreciated, even it if it's "You can't do that."

 

Thanks,

 

Steven

I'm trying to write some validation code for a contact object. I'd like to be able to access different class variables by running through a for loop and validating each variable without having to write out each one.

 

Below is some sample code:

 

public class ContactRecord {
    public String FirstName;
    public String LastName;
    public String Phone;
    public String Email;
}

public static ErrorEntry[] validateContact(ContactRecord contact) {
    ErrorEntry[] errors = new ErrorEntry[]{};
    
    Set<String> reqParams = new Set<String>{'FirstName', 'LastName', 'Email', 'Phone'};
    for (String reqParam : reqParams) {
       if (contact.[reqParam] == null) {
           // log error
       }
    }
    
    return errors;
}

 

Obviously contact.[regParam] produces a syntax error.

 

Is there a syntax in Apex where I can access the contact.FirstName variable by populating the regParam variable with 'FirstName'?

 

This is how I'd do it in Perl, but maybe that has just poluted my thinking. Any help would be appreciated.

 

Steven

I'm using Apex classes with the "with sharing" enabled.

 

I have an Event SObject in the variable "event" that is at least viewable by a user. 

 

How do I check whether that record can be updated without attempting to do a "update event" call and catching the exception?

 

I have a series of callouts that need to be performed to update an external system, but I only want to do those callouts if the current Event record is writeable.

 

Thanks,

 

Steven 

I have a VF page in a new section of the Event Detail Page Layout. I would like to get the retURL parameter (and another custom parameter) of the parent page from within the VF page, but that does not seem to be possible.

 

I realize that due cross-domain Javascript security issues this is normally not allowed, but was wondering if there was a way around this in Salesforce. Salesforce does provide me the Id parameter from the parent.

 

Thanks,

 

Steven 

Is there a way to have a managed package provide an Email Template that can then be modified be a Standard User?

 

I realized the the template can be edited using the Send Email interface during the process of sending the email, but I'd like to the user to be able to save edits to an email template where the emails are sent via Apex and not using the standard Send Email interface.

 

Any help would be appreciated.

 

Steven Fraser

iLinc Communications 

Using a Mac, I have downloaded Eclipse 3.3.2 and installed the WST and Force.com IDE per the instructions. Installation appears to install correctly, but when I go to add a new Force.com project I get an error in the project creation dialog box upon clicking the Next button.

Error:
Unable to connect to hostname 'www.salesforce.com'

Method not implemented


If I download version 12 of the IDE, I can create a Force.com project using the same settings.

Any ideas on how to resolve the issue would be greatly appreciated.

Is there a way you can create/set the Id field of a new SObject before performing an insert DML statement?

 

I know you can set it to an existing Id like this:

 

SObject s = Database.query('Select Id from account limit 1')[0].getSObjectType().newSObject([SELECT Id FROM Account LIMIT 1][0].id);

 

 

But is there a way to set it for a newly created SObject?

 

I need to create a few objects, retrieve their Ids and then send them to another system via a web service callout. I cannot issue a web service callout after the DML statement (without using @future call), so I'm trying to get the Ids and send them before actually making the insert DML statements

 

Any help would be appreciated, even it if it's "You can't do that."

 

Thanks,

 

Steven

I'm trying to write some validation code for a contact object. I'd like to be able to access different class variables by running through a for loop and validating each variable without having to write out each one.

 

Below is some sample code:

 

public class ContactRecord {
    public String FirstName;
    public String LastName;
    public String Phone;
    public String Email;
}

public static ErrorEntry[] validateContact(ContactRecord contact) {
    ErrorEntry[] errors = new ErrorEntry[]{};
    
    Set<String> reqParams = new Set<String>{'FirstName', 'LastName', 'Email', 'Phone'};
    for (String reqParam : reqParams) {
       if (contact.[reqParam] == null) {
           // log error
       }
    }
    
    return errors;
}

 

Obviously contact.[regParam] produces a syntax error.

 

Is there a syntax in Apex where I can access the contact.FirstName variable by populating the regParam variable with 'FirstName'?

 

This is how I'd do it in Perl, but maybe that has just poluted my thinking. Any help would be appreciated.

 

Steven

I've been struggling to find an answer to a pretty simple question:

Can Apex Code that makes callouts to external web services be installable in PE?

Apex would be a part of managed certified package.

 

Thanks,

Shamil

  • August 10, 2009
  • Like
  • 0

The page you submitted was invalid for your session. Please click Save again to confirm your change.

 

 

Description; In this case am calling an VF page in a section in that page am calling commandlink and outputlinks .it is working fine when it is uinmanaged packege but it failing after making packaged application i checked the name space it is fine in all the palce .Any body know about this issue please posst some clue to track it.

  • June 17, 2009
  • Like
  • 0

Hi, ForceIDE is listed in the catalog of Pulse (www.poweredbypulse.com). The ForceIDE update site recently had an upgrade and as part of that process some of the metadata became incorrectly updated. The main problem is the size of some of your artifacts does not correspond to the actual artifact sizes

 

 osgi.bundle,com.salesforce.id

 com.salesforce.ide.branding

 org.eclipse.update.feature,com.salesforce.ide.feature

 

 

We wanted to report the problem here to see if the site could please be upated. 

 

Thanks in advance!

 

Is there a way to have a managed package provide an Email Template that can then be modified be a Standard User?

 

I realized the the template can be edited using the Send Email interface during the process of sending the email, but I'd like to the user to be able to save edits to an email template where the emails are sent via Apex and not using the standard Send Email interface.

 

Any help would be appreciated.

 

Steven Fraser

iLinc Communications 

Using a Mac, I have downloaded Eclipse 3.3.2 and installed the WST and Force.com IDE per the instructions. Installation appears to install correctly, but when I go to add a new Force.com project I get an error in the project creation dialog box upon clicking the Next button.

Error:
Unable to connect to hostname 'www.salesforce.com'

Method not implemented


If I download version 12 of the IDE, I can create a Force.com project using the same settings.

Any ideas on how to resolve the issue would be greatly appreciated.
When Apex code was first released the debug log worked wonderfully! It displayed all relevant Apex info, limits, debug statements, etc.

The new version not so much. When I am working with Apex code I could care less about workflow criteria evaluations. These do nothing but get in the way and make the debug log ridiculously long. For us this is making the debug log so long it is cutting off the top of the log and with that lots of my debug statements. This has made debugging Apex extremely tedious and very painful.

With the new version you are supposed to be able to modify the logging level but this rarely works. It's as if it has a mind of its own.

Sorry for the somewhat harsh tone but it has been very frustrating digging through literally 35,000 lines of workflow evaluations only to find that my debug statements are not there.



Message Edited by TehNrd on 07-17-2008 03:34 PM
I'm recreating a detail page and I'm trying to add some related lists that are currently displayed on the existing page.  I'm unable to figure out what the list names are supposed to be though.  The names that are used in the pagelayout editor are not working.  Some example list are "Notes & Attachments", "Approval History", and "Activity History".  How do you find out the names to use in visual force for related lists?