• HugoNow
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 4
    Replies
Hi all,

Last Saturday, our org got updated to Spring '16. I deployed some changes 2 days before and it was working. However, today, I got the following exception from one of my unit tests:

|FATAL_ERROR|System.TypeException: Collection store exception adding Test1Exception to List<java.lang.Exception>

The problem can easily be reproduced by creating the folowing class:
public class Test1Exception extends Exception {
}
Then, executing the folowing code in the Execute Anonymous:
List<Exception> el = new LIst<Exception>();
el.add(new Test1Exception());
We tried to reproduce the problem in a sandbox I created this morning but no luck, we are unable to.
Anyone has this problem?

Thanks!


 
Hi all,
I am having quite a bizarre problem.

I have code inside of a trigger that does a Chatter post when a condition is met.
ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), 'me', 
			ConnectApi.FeedElementType.FeedItem, 'It is ready!');

When executed by an admin, everything is okay. But when it is executed by a user with a Chatter Only license, I get the error:

ConnectApi.ConnectApiException: FeedItemContentRevisionControl: execution of BeforeInsert caused by: System.QueryException: Implementation restriction: FeedItem requires a filter by Id Trigger.FeedItemContentRevisionControl: line 52, column 1 Class.ConnectApi.ChatterFeeds.postFeedItem: line 6395, column 1 

However, when I bypass the ConnectApi and insert directly a FeedItem, it works
INSERT new FeedItem(ParentId = UserInfo.getUserId(), Body = 'It is ready!');
I have searched around and I am not able to find a solution for this. I would like to use the ConnectApi as I have requirements for its features that I cannot do through an insert of the FeedItem.

I tried removing the 'with sharing'. I tried adding 'without sharing'. I upgraded my version to v35. I tried replacing the 'me' with UserInfo.getUserId(). I tried to find if there was a permission or configuration associated but to no avail.

Anyone has ideas about this? It this a bug?

Thanks

 
When I do this query in the Dev Console, it returns a Communication error: 
SELECT CreatedDate FROM CustomObject__c WHERE CustomField__c = 'a0Fd000000VCFnxEAH' ORDER BY CreatedDate LIMIT 1

however, when I change the LIMIT 1 to LIMIT 2 for example, it works as expected and returns 2 records. It points to a SF bug but I am not able to diagnose further.
Any ideas?
Thanks
When I do this query in the Dev Console, it returns: 
SELECT CreatedDate FROM CustomObject__c WHERE CustomField__c = 'a0Fd000000VCFnxEAH' ORDER BY CreatedDate LIMIT 1

however, when I change the LIMIT 1 to LIMIT 2 for example, it works as expected and returns 2 records. It points to a SF bug but I am not able to diagnose further.
Any ideas?
Thanks
 

Hi,

I know this is beta but this might be a bug...or maybe just me.

 

I am trying to integrate with an external system and the information I have from the external system is the BillingCountry and the BillingStateCode. I do not have the BillingState from my external system, just the code. Therefore, I am trying to create an account using the folowing:

 

Account a = new Account(Name='TestHugo', BillingCountry='Canada', BillingStateCode = 'QC');
INSERT a;

 

However I get this error:
FIELD_INTEGRITY_EXCEPTION, A country must be specified before specifying a state value for field: [BillingStateCode]

Do you know if this is a bug or if I am just not using it the right way.

 

Any ideas?

Hi,

 

I have a nice problem that I am not able to figure out. The requirement is to call a JS when pressing a button. The button passes a parameter to the javascript and I want to be able to read that parameter in the controller to generate a string. Then use that generated string in the VF page. I use multiple buttons (depending on the functionality) and somehow, there is an AJAX refresh problem I can't put my finger on.

 

The problem is easily reproducable using the code here. To reproduce: press the first and second button one after the other multiple times, you will see that sometimes, the alert message does not correspond to the button. It seems like it shown the last value. But sometimes, it works. Can't figure out a pattern.

 

Please help!

 

<apex:page controller="ActionFunctionDemoController">
  <apex:form >
      <apex:outputPanel id="jspanel"> 
          <script>  
              function onControllerReturn() {
                alert('{!Msg}')
              }
          </script>
      </apex:outputPanel>
 
      <apex:actionFunction name="doControllerSend" action="{!SendParam}" rerender="jspanel" >
          <apex:param name="param" value="" />
      </apex:actionFunction>
 
      <apex:commandButton onclick="doControllerSend('Param 1');" oncomplete="onControllerReturn()" value="Send Param 1"/>
      <apex:commandButton onclick="doControllerSend('Param 2');" oncomplete="onControllerReturn()" value="Send Param 2"/>
  </apex:form>
</apex:page>

 

public class ActionFunctionDemoController{
   public ActionFunctionDemoController() {}

   public String Msg {get; set;}
   public PageReference SendParam() {
        String param = ApexPages.currentPage().getParameters().get('param');

        Msg = 'Param='+param;
        return null;
   }
}

 

Hi all,

Last Saturday, our org got updated to Spring '16. I deployed some changes 2 days before and it was working. However, today, I got the following exception from one of my unit tests:

|FATAL_ERROR|System.TypeException: Collection store exception adding Test1Exception to List<java.lang.Exception>

The problem can easily be reproduced by creating the folowing class:
public class Test1Exception extends Exception {
}
Then, executing the folowing code in the Execute Anonymous:
List<Exception> el = new LIst<Exception>();
el.add(new Test1Exception());
We tried to reproduce the problem in a sandbox I created this morning but no luck, we are unable to.
Anyone has this problem?

Thanks!


 
When I do this query in the Dev Console, it returns: 
SELECT CreatedDate FROM CustomObject__c WHERE CustomField__c = 'a0Fd000000VCFnxEAH' ORDER BY CreatedDate LIMIT 1

however, when I change the LIMIT 1 to LIMIT 2 for example, it works as expected and returns 2 records. It points to a SF bug but I am not able to diagnose further.
Any ideas?
Thanks
 

Hi,

I know this is beta but this might be a bug...or maybe just me.

 

I am trying to integrate with an external system and the information I have from the external system is the BillingCountry and the BillingStateCode. I do not have the BillingState from my external system, just the code. Therefore, I am trying to create an account using the folowing:

 

Account a = new Account(Name='TestHugo', BillingCountry='Canada', BillingStateCode = 'QC');
INSERT a;

 

However I get this error:
FIELD_INTEGRITY_EXCEPTION, A country must be specified before specifying a state value for field: [BillingStateCode]

Do you know if this is a bug or if I am just not using it the right way.

 

Any ideas?

Hi,

 

I have a nice problem that I am not able to figure out. The requirement is to call a JS when pressing a button. The button passes a parameter to the javascript and I want to be able to read that parameter in the controller to generate a string. Then use that generated string in the VF page. I use multiple buttons (depending on the functionality) and somehow, there is an AJAX refresh problem I can't put my finger on.

 

The problem is easily reproducable using the code here. To reproduce: press the first and second button one after the other multiple times, you will see that sometimes, the alert message does not correspond to the button. It seems like it shown the last value. But sometimes, it works. Can't figure out a pattern.

 

Please help!

 

<apex:page controller="ActionFunctionDemoController">
  <apex:form >
      <apex:outputPanel id="jspanel"> 
          <script>  
              function onControllerReturn() {
                alert('{!Msg}')
              }
          </script>
      </apex:outputPanel>
 
      <apex:actionFunction name="doControllerSend" action="{!SendParam}" rerender="jspanel" >
          <apex:param name="param" value="" />
      </apex:actionFunction>
 
      <apex:commandButton onclick="doControllerSend('Param 1');" oncomplete="onControllerReturn()" value="Send Param 1"/>
      <apex:commandButton onclick="doControllerSend('Param 2');" oncomplete="onControllerReturn()" value="Send Param 2"/>
  </apex:form>
</apex:page>

 

public class ActionFunctionDemoController{
   public ActionFunctionDemoController() {}

   public String Msg {get; set;}
   public PageReference SendParam() {
        String param = ApexPages.currentPage().getParameters().get('param');

        Msg = 'Param='+param;
        return null;
   }
}