• PerGeert
  • NEWBIE
  • 30 Points
  • Member since 2006

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 32
    Replies

In some Apex triggers I create a new record on which there is a field Contact Person (a link to Users). I want automatically to make this contact person a Chatter Follower of the record so that he/she is notified, should anyone add a Chatter comment to the record. How to?

I've set up a simple trigger to insert a FeedPost when one of my Customer Portal Users creates an entry through Sites and found that the trigger only works when I create an entry from inside Salesforce (as a regular SF user).

 

When a Customer Portal User creates an entry, the trigger fails with the error: "Invalid type: FeedPost"  

 

The API version on all the code is 18.0.

 

I've also tried putting the "insert FeedPost" call in a class without sharing, but it still fails in the Customer Portal context.

 

What are the limitations on integration Chatter with Sites and Customer Portal Users?   Can we even trigger chatter activity from portal user actions?

 

- R

 

 

(This is just a test case ... I know the trigger isn't set up to handle bulk inserts)

 

 

trigger ItemReview on Item_Review__c (after insert) {

	
	for (Item_Review__c review :trigger.new) {
		Chatter.feedPost(review.Item__c,  'A review has been posted for this item.'
				,null);
		
	}

}

 

 

 

 

 

public without sharing class Chatter {

	public static void feedPost(String parentId, String body, String link) {
		try {
		   FeedPost fpost = new FeedPost();
		   fpost.ParentId = parentId; //eg. Opportunity id, custom object id..
    		    fpost.Body = body;
    		    insert fpost;	
            	 
        } Catch (Exception ex) {
            	
        }
		
	}
}

 

 

When users create customer reports(Tabular Report), they want to use another name to replace the field label in page layout. How to implement it?

 

Thanks

Hi,

 

I want to lock particular Record on some condition.

 

Ex: I will include one custom field(check box) in Opportunity as "Lock". If this is checked for any Opportunity, then that Opportunity should not be accessible by any other group (Ex: Sales, Marketing).

How can I achieve this?

 

Thanks for any help.....

 

 

Looking at event in a Public Calendar, the prefix of the OwnerId is '023'. What object type is that?

I have a custom object, Equipment, which I want to relate to a Calendar object. The purpose being, that each Equipment (a demo machine) has a calendar about availability attached. Does not seem to be possible directly to make the Calendar a related/lookup relationship to another object. Any ideas how to do this?
The class attribute isn't being set when I use outputField. As you can see in my example the HTML output is missing the class attribute which was set to XXX


My Page:


<apex:page controller="TestPageCon">
<apex:outputField styleClass='XXX' value='{!field.amount}'/>
</apex:page>


My Controller:


public class TestPageCon {
public Opportunity getField() {
return [select id, amount from Opportunity limit 1];
}
}


Actual HTML output:


<span id="j_id0:j_id1">$60,000.00</span>

Where did my XXX go?

All-
 
I searched the boards for this one with no luck. I have a trigger that is throwing an error in certian cases. I have not been able to identify the exact use case that is throwing the error...but I thought I would throw it out here to see if anyone has seen this.
 
I have a trigger that is on the event that figures the next activty data for all accounts it is associated with. Basically every time an event is saved I go out and figure out all contacts and accounts associated with it then grab all events assocaited with them then figure out when the next event is. Then I stick that date on the accounts. This way the reps know when there next event is on the list views.
 
So every so often I get this error sent to me.
 
Code:
"ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE, entity failed ifModifiedBefore "
 
I looked in the documentation and found this def of the error:
 
Code:
"You cannot update a record if the date inLastModifiedDate is later than the current date. "

 
However I am not setting/touching the last modified date. Very wierd. Not sure what is going on. Items to note...this is in a international org and the error only seems to be being triggered by users in Japan.
 
Any help/insight would be greatly appreciated!
 


Message Edited by tinman44 on 12-29-2008 07:37 AM

Message Edited by tinman44 on 12-29-2008 07:37 AM


I have a scontrol, which basically does this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/12.0/connection.js"></script>
    
    <script type="text/javascript">  
 window.onload=init_page(); 
 function init_page() 
 { 
    var result; 
    var strSQL = "Select Id,StartDate,ProductFamily,Quota,Closed,Commit,Upside,Pipeline,CurrencyIsoCode from RevenueForecast where OwnerId='{!$User.Id}' and StartDate >= 2008-04-01 and StartDate <= 2009-03-31 order by ProductFamily"; 
           try {
  result = sforce.connection.query(strSQL);
    } catch(err) { alert(err); alert('SQL blowup');}
 
 } 
 </script> 
</head> 
<body></body> 
</html>

When I execute it as System Administrator, it works as expected. However, when I execute with another profile, I get an error:

{faultcode:'sf:INVALID_TYPE', faultstring:'INVALID_TYPE: sObject type 'RevenueForecast' is not supported.', ...}

Which security settings (besides API enabled) must the user's profile have in order to read RevenueForecast?
 

My org has translation workbench enabled and all the labels, picklist values and messages are translated to different languages. I would like to develop a Visualforce page that shows data collected from several objects in the user's language. Most of the information can be reached using merge fields without programming a controller extension, but merge fields that reference picklist values show  the master value, not the label in the user's language, is there any way to translate the picklist value using merge fields, something like "tolabel"? If not, I presume that I will have to develop a controller extension and use Describe functions, or is there any other easier way?
Is there a prescribed way to manage the saving of phone numbers in a desired format? 5555551212 or 555 555-1212 would automatically be saved as (555) 555-1212 etc.? I notice on a user form, the field has built in phone formatting while typing. Any way to do that?
First time poster & new to SFDC.
 
For a contact I am trying to calculate the next anniversary date based on a historical registration date (which could be many years previous), to drive a workflow for a reminder e-mail and follow up task to record owner using the Time Based work flow. 
 
The formula that I have used previously, suggested in SFDC documentation (to calculate Next birthday), calculates correctly when using the standard contact Birthdate field, but when I apply the same formula to a custom date field the compilation exceeds the maximum 5000 characters (Error: Compiled formula is too big to execute (5,262 characters). Maximum size is 5,000 characters) 
 
Current formula below and any suggestions on reducing formula size or alternate approaches will be appreciated greatly.
 
IF(MONTH(AppDate__c)>MONTH(TODAY()),DATE(YEAR(TODAY()),MONTH(AppDate__c),DAY(AppDate__c)),
IF(MONTH(AppDate__c)<MONTH(TODAY()),DATE(YEAR(TODAY())+1,MONTH(AppDate__c),DAY(AppDate__c)),
IF(DAY(AppDate__c) >= (DAY(TODAY())),DATE(YEAR(TODAY()),MONTH(AppDate__c),DAY(AppDate__c)),
DATE(YEAR(TODAY())+1,MONTH(AppDate__c),DAY(AppDate__c)))))
 
Regards
 
 
Paul
Scrolled down many of posts here in Community but couldnt find one solution on how to avoid 'Too many DML rows' error.
 
Probably am i missing some community link then pls help me to get to that solution.
 
I am looking to mass update all contacts attached to a account. I do fetch all contacts using inbound SOQL query which do handles bulk processing too.
 
Now when it comes to update all contacts of all accounts which came into trigger, I do create a array and send tht entire array to update call which exceeds the limit of 100.
 
Is there any querymore or .. any other approach to be used .. pls let me know in detail on how to handle 100+ updates in Apex Trigger.
 
Thanks in advance
I'm trying to create a validation rule using the new VLOOKUP function.  The idea is:
* Registrations are detail-master to Programs
* Faimly Groups are also detail-master to Programs
* Registrations has lookup relationship to Family Groups
* want to limit so that you can only choose a Family Group that belongs to the same Program that the Registration belongs to

So basically this is a workaround to get around the lack of filtered lookups.

I tried writing the validation rule to look like this:

Code:
NOT ( 
VLOOKUP( $ObjectType.Family_Group__c.Fields.Program__c ,  
$ObjectType.Family_Group__c.Fields.Id , Family_Group__r.Id ) = Program__r.Id )

 However, this gives me an error of "Incorrect parameter for function VLOOKUP(). Expected Record Name field." which is rather inscrutable, I'm sure you'll agree.

From experimentation, I've found that it works if I replace those Id fields with Name fields.  However, I don't want to do that, as Family Group names are not necessarily unique.

Why doesn't it work with the Id's?  Is there some reason that this function won't accept Id fields as parameters?  If so, is that something that could be changed?  This is probably the most important potential use of this function in validation rules.

BTW, the documentation is not clear on this.  The only thing it says is "The field_on_lookup_object must be an indexed field."  But I can't find anywhere what constitutes an Indexed Field in SFDC, so that's not too helpful.

Thanks for any help!

M.

Hello,
i have problems when i will Logon to SF wir my Excel Connector.
I enter my Username und my Password and use the URL:
https://www.salesforce.com/services/Soap/c/6.0

But the following error occurs:
Error Generated by request::Unable to send request to server. A connection with the server could not be established

ExceptionCode : 5103

The sforce Connector Version is 6.16 and the Office Toolkit Version is 3.0

Thank you in advice.