• Gravity
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies

Looks like I am almost there but can't connect the final steps...

 

I have added a Custom button on top of my related list in a standard page layout. Now I want to select some records from the related list and pass those record IDs to a visual force page when I click the button.

 

Was able to call an Apex class on click of the button (http://developer.force.com/cookbook/recipe/creating-a-button-with-apex) and process those selected records using the method described in the article.

 

But I want to send the user to a visalfore page where they can see more details from the selected records, before calling my script.

 

Thanks and appreciate your help in advance.

 

Not an expert with Apex, but I was assuming this should work.

 

My code is creating a record with values received thru a webservice call, I am trying to set the RecordType using one of the values I received. Code for setting recordtype looks something like this:

 

Map<String,RecordType> acctRecordTypes = new Map<String,RecordType>([select NAME from RecordType where SOBJECTTYPE='Account']);

...............................................................

if(nodeName=='AccountType')   acctTypeCode=node.getText();

 .....................................................
RecordTypeId=acctRecordTypes.get(acctTypeCode).ID,

 

 

 

Fails on the last line and gives an error message: "System.NullPointerException: Attempt to de-reference a null object"

 

Was able to isolate the problem to this line using debug as well, hardcoding the RecordTypeID value gives no errors.

 

 

Thanks for taking the time to read and any help you offer.

 


 

Not an expert with Apex, but I was assuming this should work.

 

My code is creating a record with values received thru a webservice call, I am trying to set the RecordType using one of the values I received. Code for setting recordtype looks something like this:

 

Map<String,RecordType> acctRecordTypes = new Map<String,RecordType>([select NAME from RecordType where SOBJECTTYPE='Account']);

...............................................................

if(nodeName=='AccountType')   acctTypeCode=node.getText();

 .....................................................
RecordTypeId=acctRecordTypes.get(acctTypeCode).ID,

 

 

 

Fails on the last line and gives an error message: "System.NullPointerException: Attempt to de-reference a null object"

 

Was able to isolate the problem to this line using debug as well, hardcoding the RecordTypeID value gives no errors.

 

 

Thanks for taking the time to read and any help you offer.