• radan
  • NEWBIE
  • 0 Points
  • Member since 2008

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

I have custom objects in my application.

My Dev ORG is chatter enabled and I have enabled Feed track changes on fields of these objects. 

According to Chatter cheat sheet, a custom object Foo__c will have a record feed named Foo_Feed__c.

 

For the following code (from Chatter Recipe)

public List<HlistItem_Feed__c> getRecipeNineFeedTrackedChanges()
    {
        List<HlistItem_Feed__c> af = [Select id, Parent.Name,
            (SELECT Id, FieldName, NewValue,OldValue FROM FeedTrackedChanges) 
            from  HlistItem_Feed__c LIMIT 100];
        
        for(HlistItem_Feed__c f : af)
        {
            System.debug(f.FeedTrackedChanges.size());
            
            for(Integer i = 0; i < f.feedTrackedChanges.size(); i++)
                System.debug(LoggingLevel.INFO, 
                    'Change on '+f.feedTrackedChanges.get(i).fieldName+
                    ' is '+f.feedTrackedChanges.get(i).NewValue+
                    ' (old Value)'+ f.feedTrackedChanges.get(i).OldValue);
        }   
        return af;
     
    }

 

public List<MyCustom_Feed__c> getRecipeNineFeedTrackedChanges()    {        

           List<MyCustom_Feed__c> af = [Select id, Parent.Name,

                                                                      (SELECT Id, FieldName, NewValue,OldValue FROM FeedTrackedChanges)

                                                                     from  MyCustom_Feed__c LIMIT 100];    

        ...

}  

 

I get the following compile error: 

Error: Compile Error: sObject type 'MyCustom_Feed__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. 

 

Any ideas on what is wrong here? 

  • June 28, 2010
  • Like
  • 0

In our Development ORG, we have licenses for Salesforce Platform  users.

when I create a new user and assign the User License to Salesforce Platform, the ONLY allowed profile is Standard Platform User which does not have any permissions to our custom objects.

According to SF documentation, a platform user license is allowed access to custom apps. 

 

I would appreciate it, if any one can show me how to change the profile for a Salesforce Platform license; or edit the Standard Platform Profile to provide access to custom objects.

 

Thanks. 

  • May 22, 2010
  • Like
  • 0

How does one access in Apex, the approval comments, history associated with a record that has gone through an approval process?

 

The Web Services API describes a ProcessInstanceHistory object - but also says it cannot be queried.

The documentation says:

 

 

Usage
To retrieve this object, issue a describe call on an object, which will return a query result for each ProcessInstance since the

object was created. You cannot use query().

To retrieve this object, issue a describe call on an object, which will return a query result for each ProcessInstance since theobject was created. You cannot use query().

 

To retrieve this object, issue a describe call on an object, which will return a query result for each ProcessInstance since theobject was created. You cannot use query().

 

Apex SObjectDescribe methods do not seem to provide a way to access the process history. 

 

Any clarification/help with getting access to the Approval Process history for a record would be much appreciated.

 

  • May 11, 2010
  • Like
  • 0

In our application, an use case calls for a detail record (with notes, attachments etc.) to be moved from one master record to another. This is very easy to do with a Lookup relationship; but we have to use Master-detail for various reasons. 

 

Currently I am cloning the detail record (and all Notes..) and creating a new detail record and adding it to the new master. This has a undesirable side effect of changing the time stamps and LastModifiedBy, CreatedBy,.. system fields. 

I would like to be able to preserve these attributes. 

 

Is there a way to accomplish this? 

  • May 06, 2010
  • Like
  • 0

I am trying to delete some existing Custom Resource records using Apex. Here the custom Resource is called AcField

The fragment of code:

-------

       //blowing off all existing custom resources 

     Map<string,AcField__C> cfCurrMap = AcField__C.getAll(); //get all existing records 

     Set<string> existingCRs = cfCurrMap.keySet(); 

     List<AcField__C> existingL =  new List<AcField__C>();

     for (string ex: existingCRs) { //add to list to delete 

     existingL.add(cfCurrMap.get(ex));

     }

//delete any 

     if (existingL.size() > 0) {

     delete existingL;

    

--------- 

The resulting behavior is inconsistent. Some times a subset of records get deleted, sometimes no records get deleted.

Could some one point out what the issue is?

 

Thanks

  • January 06, 2010
  • Like
  • 0

I included some custom tab definitions in a managed-released package. Those tabs are no longer necessary and I want to remove them from future versions of the package.

Could any one enlighten me on how to do this?

I can make this tab hidden from all profiles - but is there a way to clean up the package definition? 

 

Thanks for your help.  

  • October 27, 2009
  • Like
  • 0

I am trying to conditionally include a style sheet based on browser type. For example -

 

<!-- [if IE]> <apex:stylesheet value="{!URLFOR($Resource.ext221, 'resources/css/FIX-v221.css')}" />
<![endif] -->

 

 The comment above is stripped out by VF processing. I saw a posting on this forum suggesting that a work around would be to replace this by:

 

&lt;!--  [if IE]> <apex:stylesheet value="{!URLFOR($Resource.ext221, 'resources/css/FIX-v221.css')}" />

<! [endif] --&gt;

 

This works for IE but on other browsers, this is not treated as a comment.

I get a 'element is not well formed' error and  the CSS is included anyway with incorrect results.. 

  

    Any help with this would be much appreciated

 

  • September 26, 2009
  • Like
  • 0

I am developing an Apex class to create records by parsing a .csv file.  

I was expecting a CSV file to appear as a textAttachment in the email object. The MIME type for a CSV file is (according to RFC 4180) is text/csv. This actually appears as a binaryAttachment with MIME type application/vnd.ms-excel. I am saving the file as CSV (comma separated values) in Excel

 

Is there a way to get a CSV file as a text attachment (whose body is then a Apex String instead of a blob)?  

Any pointers would be greatly appreciated.

 

Thanks.  

 

 

  • March 04, 2009
  • Like
  • 0

I would appreciate some pointers on this.

I am trying to clone a master record (say M__c) that has some children detail records (MC__c)

I queried the master records and created a deep copy by calling

 

     M__c.clone(false,true); //do not preserve Id & do a deep clone

 

This does not seem to null out the children/detail record ids. 

When I insert the cloned master record, it creates a copy alright but there are no details.

 

I tried cloning the individual MC__c records and adding them to the cloned parent's child relationship array.

That did not help. 

Could some one point me to a code snippet or documentation for the correct way to do this?

 

Thanks

  • February 22, 2009
  • Like
  • 0

I am invoking Apex code in this manner:
    
   var result = sforce.apex.execute(...);
 
The Apex code  is returning a value of type Id.  

If I grab this result and assign it to a field value that requires an Id, and invoke the connection.insert or update methods,

I get an error "duplicate values specified for <field>"  and an exception is thrown in connection.js

The work around I am using is to return a string value instead and assign it to another string

Like:

       var res = '';  result = sforce.apex.execute(..); res += result

 

Now if i use the res as the value for Id fieldinsert/update etcsucceed.

[If I directly use result  which is of String type now, I get the same duplicate values specified error. When I dump the value of the variables to console, they look ok..]

 

Can someone enlighten me on the correct way to 

unpack result values returned by sforce.apex.execute() call?

The documentation example provided uses the return values with out any subsequent massaging.

 
      Thanks 
    

  • February 17, 2009
  • Like
  • 0

I am invoking Apex methods from JavaScript using sforce.apex.exeute()
How do I see the debug output from the Apex code?The SOAP invocation returns an error. The system log window does not show anything.
When I look at the debug logs under Setup->Monitoring->Debug Logs, the log shows up with a large time lag.

Any pointers will be much appreciated.

  

  • February 16, 2009
  • Like
  • 0
Hello All,   
          I have a requirement that is very similar to some existing posts in the s-control thread.
          I need to be able to provide a file browser dialog to select one or more files and upload them;
          and also create/update files on the client machine based on content in the database.
          What is the best way to accomplish this?  Any pointers will be greatly appreciated.
     
  • October 28, 2008
  • Like
  • 0

I have custom objects in my application.

My Dev ORG is chatter enabled and I have enabled Feed track changes on fields of these objects. 

According to Chatter cheat sheet, a custom object Foo__c will have a record feed named Foo_Feed__c.

 

For the following code (from Chatter Recipe)

public List<HlistItem_Feed__c> getRecipeNineFeedTrackedChanges()
    {
        List<HlistItem_Feed__c> af = [Select id, Parent.Name,
            (SELECT Id, FieldName, NewValue,OldValue FROM FeedTrackedChanges) 
            from  HlistItem_Feed__c LIMIT 100];
        
        for(HlistItem_Feed__c f : af)
        {
            System.debug(f.FeedTrackedChanges.size());
            
            for(Integer i = 0; i < f.feedTrackedChanges.size(); i++)
                System.debug(LoggingLevel.INFO, 
                    'Change on '+f.feedTrackedChanges.get(i).fieldName+
                    ' is '+f.feedTrackedChanges.get(i).NewValue+
                    ' (old Value)'+ f.feedTrackedChanges.get(i).OldValue);
        }   
        return af;
     
    }

 

public List<MyCustom_Feed__c> getRecipeNineFeedTrackedChanges()    {        

           List<MyCustom_Feed__c> af = [Select id, Parent.Name,

                                                                      (SELECT Id, FieldName, NewValue,OldValue FROM FeedTrackedChanges)

                                                                     from  MyCustom_Feed__c LIMIT 100];    

        ...

}  

 

I get the following compile error: 

Error: Compile Error: sObject type 'MyCustom_Feed__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. 

 

Any ideas on what is wrong here? 

  • June 28, 2010
  • Like
  • 0

How does one access in Apex, the approval comments, history associated with a record that has gone through an approval process?

 

The Web Services API describes a ProcessInstanceHistory object - but also says it cannot be queried.

The documentation says:

 

 

Usage
To retrieve this object, issue a describe call on an object, which will return a query result for each ProcessInstance since the

object was created. You cannot use query().

To retrieve this object, issue a describe call on an object, which will return a query result for each ProcessInstance since theobject was created. You cannot use query().

 

To retrieve this object, issue a describe call on an object, which will return a query result for each ProcessInstance since theobject was created. You cannot use query().

 

Apex SObjectDescribe methods do not seem to provide a way to access the process history. 

 

Any clarification/help with getting access to the Approval Process history for a record would be much appreciated.

 

  • May 11, 2010
  • Like
  • 0

In our application, an use case calls for a detail record (with notes, attachments etc.) to be moved from one master record to another. This is very easy to do with a Lookup relationship; but we have to use Master-detail for various reasons. 

 

Currently I am cloning the detail record (and all Notes..) and creating a new detail record and adding it to the new master. This has a undesirable side effect of changing the time stamps and LastModifiedBy, CreatedBy,.. system fields. 

I would like to be able to preserve these attributes. 

 

Is there a way to accomplish this? 

  • May 06, 2010
  • Like
  • 0

I am developing an Apex class to create records by parsing a .csv file.  

I was expecting a CSV file to appear as a textAttachment in the email object. The MIME type for a CSV file is (according to RFC 4180) is text/csv. This actually appears as a binaryAttachment with MIME type application/vnd.ms-excel. I am saving the file as CSV (comma separated values) in Excel

 

Is there a way to get a CSV file as a text attachment (whose body is then a Apex String instead of a blob)?  

Any pointers would be greatly appreciated.

 

Thanks.  

 

 

  • March 04, 2009
  • Like
  • 0