• rkirkpat
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 7
    Replies

As I understood it Salesforce is phasing out S-Controls and using Visualforce pages to replace that functionality.

 

Is the OnClick Javascript option on custom buttons going to stick around? Or is it to be replaced with Visualforce pages as well? 

I'm trying to get a hold of Id values for a set of OpportunityContactRole records.

 

 

Select Id, (Select Id From OpportunityContactRoles) From Opportunity Where Marker_Field__c = 'ag7105survey'

 

Am I missing something?

 

Thanks

 

Under storage usage in setup,I don't see a starage amount determined for the OpportunityContactRole records. Might they be lumped into the Opportunity object's total storage amount?

 

 

Also I saw a post that claimed data storage was determined as 2k per record, regardless of the amount of acutal data or number of fields. I haven't been able to find that in the official documentation, could someone confirm or deny this? A link to the relevent documentation would be a nice bonus, if it is convinient enough to share.

 

Thank you

 

The goal:

A trigger that creates a task after insert and after update. The task is to be linked to the opportunity record (WhatId), primary contact (WhoId) and contact's account.

 

The problem:

Apparently an after trigger executes before the creation of the opportunitycontactrole record that links the opportunity and contact records together. When the trigger is firing after insert the SOQL query I used has no record to lift the ContactId from. So only tasks created by the trigger after update have the WhoId field filled in.

 

At least that's what I think is happening...

 

The question:

Is there a way to get a hold of the appropriate ContactId when the trigger is fired by insertion?

 

Thanks

 

 

Just got done with 'Hello World!' and am working on my second trigger.

 

I seem to be missing something basic. My trigger causes the following error message When I create or edit a new opportunity record:

 

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger ThankYouTask2 caused an unexpected exception, contact your administrator: ThankYouTask2: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.ThankYouTask2: line 18, column 35

 

 

Here's the code:

 

 

trigger ThankYouTask2 on Opportunity (after insert, after update) { Set<ID> OppIds = new Set<ID>(); for(Opportunity opp : trigger.new){ OppIds.add(opp.Id); } Map<ID, OpportunityContactRole> OppMap = new Map<ID,OpportunityContactRole>([select ContactId, OpportunityId from OpportunityContactRole where IsPrimary = TRUE AND OpportunityContactRole.Id in :OppIds]); List<Task> ThankYous = new List<Task>(); for(Opportunity Opp : trigger.new){ //Construct a task to be added to the ThankYou list Task ty = new Task(); ty.WhatId = Opp.Id; ty.WhoId = OppMap.get(Opp.Id).ContactId; //???????? For new opportunity records the Id is Null... can't be used for-Wait a minute, AFTER INSERT, UPDATE!!!! ty.OwnerId = Opp.Id; ty.Subject = 'Thank You'; ThankYous.add(ty); } insert ThankYous; }

 

 

 

 Anyone with some enlightenment to spare me will be much appreciated!

I would like to construct a text string that includes a date. The date is to be calculated by adding or subtracting days from one of the records date fields.

 

Problem: Expecting Text and receiving Date.

 

How may I solve this? 

I have been browsing this discussion boards on this topic. So far all I have found are suggestions to create a report with various criteria.

Is there a way to actually create roll-up fields on the Campain object? If not, does anyone understand why?

As the Campaign object seems to be the "master" of the master-detail relationships with other tables, it seems like this would be a relatively easy thing to accomplish.

Thank you,

Robert
Hello,

I would like to add a field to the object that relates Contacts to Campaigns. The name of this object is CampaignMember I believe. If it is possible, it would be great to set up a page layout for records on this object as well.

So far I haven't found a way to access this table/object directly. Has anyone had any luck with this?

Thank you,

Robert

The goal:

A trigger that creates a task after insert and after update. The task is to be linked to the opportunity record (WhatId), primary contact (WhoId) and contact's account.

 

The problem:

Apparently an after trigger executes before the creation of the opportunitycontactrole record that links the opportunity and contact records together. When the trigger is firing after insert the SOQL query I used has no record to lift the ContactId from. So only tasks created by the trigger after update have the WhoId field filled in.

 

At least that's what I think is happening...

 

The question:

Is there a way to get a hold of the appropriate ContactId when the trigger is fired by insertion?

 

Thanks

 

 

Just got done with 'Hello World!' and am working on my second trigger.

 

I seem to be missing something basic. My trigger causes the following error message When I create or edit a new opportunity record:

 

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger ThankYouTask2 caused an unexpected exception, contact your administrator: ThankYouTask2: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.ThankYouTask2: line 18, column 35

 

 

Here's the code:

 

 

trigger ThankYouTask2 on Opportunity (after insert, after update) { Set<ID> OppIds = new Set<ID>(); for(Opportunity opp : trigger.new){ OppIds.add(opp.Id); } Map<ID, OpportunityContactRole> OppMap = new Map<ID,OpportunityContactRole>([select ContactId, OpportunityId from OpportunityContactRole where IsPrimary = TRUE AND OpportunityContactRole.Id in :OppIds]); List<Task> ThankYous = new List<Task>(); for(Opportunity Opp : trigger.new){ //Construct a task to be added to the ThankYou list Task ty = new Task(); ty.WhatId = Opp.Id; ty.WhoId = OppMap.get(Opp.Id).ContactId; //???????? For new opportunity records the Id is Null... can't be used for-Wait a minute, AFTER INSERT, UPDATE!!!! ty.OwnerId = Opp.Id; ty.Subject = 'Thank You'; ThankYous.add(ty); } insert ThankYous; }

 

 

 

 Anyone with some enlightenment to spare me will be much appreciated!

While I was playing around with VF I thought it would of been helpful if I could take the Original Page Layout of an Account record and just make some changes to how it works using visual force (eg. Hide some fields based on a value that is in a picklist field)

 

So i went on ideas and I thought this may be similar to the power that I would want to have:

http://ideas.salesforce.com/article/show/10091122/Allow_VisualForce_Detail_Page_to_be_an_edit_form

 

Just thought some would want this same feature!

 

 

Does anyone have a workaround to this ?

  • June 27, 2009
  • Like
  • 0

I would like to construct a text string that includes a date. The date is to be calculated by adding or subtracting days from one of the records date fields.

 

Problem: Expecting Text and receiving Date.

 

How may I solve this?