• Wim van Beek
  • NEWBIE
  • 30 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 8
    Replies
When reading a incomming POST call into Salesforce site, the ApexPages.currentPage().getContent() does not work. Schould this function return the data (as blob etc.)  Ref https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_System_PageReference_getContent.htm indicates it would, but at runtime I get all kind of bizar errors. Any idea or experiences?
Using ApexPages.currentPage().getHeaders() and ApexPages.currentPage().getParameters()  work fine
Situation: Managed package activates apex-classes from other managed package. Works fine. !
eg. Managed package PacA, calls PacB.Apexclass
As said: works ok.
"ApexMaster thisApexClass = (ApexMaster)(Type.forName(ThePrefix, theScript).newInstance());"
thisApexClass.xyz ....

I can not got this to work for a ApexClass NOT part of a managed package. What value need to be in 'ThePrefix' and/or 'theScript' to get it working

Any help is welcome
This happenend today without any warning, any calls from 'site' fails with this message.
Cannot find the field. !
The message appears in the 'preview as admin'
See this as a warning for everyone using Metadata type. 
When adding a boolean field to an existing set of lines, this boolean shows as false, but in APEX it does not react as false. Marked the field and unmarked same field solved the issue for me.

Looks like the field is not initiale correct for SOQL queries. It showed correct values.
Be aware
I use an external object with custom connection to connect a external source to SF. Works fine and the data is being displayed correct in a table in SF.
When doing a request in Apex [SELECT id FROM etc.] my problems started.
It fails with some records only. In debug I see the starting of the query and the next line indicates an exit of the current procedure. Do not see any outgoing call etc. It justs stops.
Tried to delete the external object in SFDC as the documentation indcated that it will store id's only. Does not work either.
Again, if only fails if I do a query in APEX to certain external keys.
Like to clear the relevant records and/or table to make sure it is not a local issue. Any help is welcome

 
As part of lightning connect any update towards the external database has to be done with a Database.insertAsync action
<List<Database.SaveResult> results = Database.insertAsync(external obj records)>
In the documentation it states that it (the execution of the update/insert process) will start whenever there is some capacity to perform. Now I am facing the execution of these processes to be started after 5 to 12 minutes. Hardly real-time intergration !
Is there any way to control these extreem times ! or is this just a system problem (working on cs80).
Please share your thoughts/experiences
When writing a testclass for an external Object (using custom connector) it will not make the call, but simply return 0 results. Setting SeeAllData=true will start this process (according to the debug-log) but the process dies with a 2090095466-45801 (64356364) error.
When inserting an external object, it must be done with Database.insertAsync and a callback function. In this callback function there is a Database.SaveResult.getId() to indicate the reference to the record just created and stored in SFDC.

Would need a referencefield as part of the insertAsync method() to return this value again as part of Database.SaveResult.

Anyone a clue how to do this? The returned id in the callback cannot lead me back to the original inserted rows.

 
Working with external objects I am facing issues in a testclass.
1. Inserting a (list of) record requires to use of a call like this.
List<Database.SaveResult> results = Database.insertAsync(theNewRecords, new CallbackClass());
In this CallBackClass a "override public void processSave(Database.SaveResult saveResult)" will provide assistance to process the newly formed id of this insert.

Works fine in real-live. How can I test-run this processSave method? The test.stoptest() does not do the trick.

 
When requesting the version of a package that runs, we can use the system.requestVersion() with MinorVersion, MajorVersion and Patch

This last one does not seem to give any other results than null, even in a pach-dev and in a pusched version.

Is there any hidden trick, or is this function not working?
Any help is welcome
I have a function to find all fields from an object
"map<string, Schema.SObjectField> FieldMap = schemaMap.get(ObjectName).getDescribe().fields.getMap();"
I convert it info a , delimmited string of fieldnames
Works fine and with
String SOQLtxt = 'SELECT ' + NNset.GetFields('User') + ' FROM User WHERE IsActive = true  ' ; 
I can us it perfect.
However when I deploy a package, it claims the fields like 'billingaddress' and 'shippingaddress' in account cannot be used. (idem for some fields in contact and user etc.) 
The testclasses in de IDE do not show these fields, in the packages-process they do.

Odd ...

Any Clue?

 
I create large amounts of feeds (via groups) including a pdf-file. Works fine.
I need to delete the old feeds and files permantly with apex in a backgroud-process. I manage to delete the feeds itself

delete [SELECT id FROM CollaborationGroupFeed WHERE xx LIMIT 1000];

and they are gone, but the files stay behind occupiing space and they need to go as well.

Cannnot find the right spot to do this.
I am looking for a solution to send a personal message to one specific user.

Now i use in a trigger
<cut some lines here>
ConnectApi.FeedItem feedItemRep = ConnectApi.ChatterFeeds.postFeedItem(Null, ConnectApi.FeedType.UserProfile, UserId, BinSegment);

and the message is forwarded to the user as indicated in UserId.

BUT

If an user starts following another user, he/she gets all messages from the other.

How can i force the message to be send to that one user only !

This happenend today without any warning, any calls from 'site' fails with this message.
Cannot find the field. !
The message appears in the 'preview as admin'
I use an external object with custom connection to connect a external source to SF. Works fine and the data is being displayed correct in a table in SF.
When doing a request in Apex [SELECT id FROM etc.] my problems started.
It fails with some records only. In debug I see the starting of the query and the next line indicates an exit of the current procedure. Do not see any outgoing call etc. It justs stops.
Tried to delete the external object in SFDC as the documentation indcated that it will store id's only. Does not work either.
Again, if only fails if I do a query in APEX to certain external keys.
Like to clear the relevant records and/or table to make sure it is not a local issue. Any help is welcome

 
When inserting an external object, it must be done with Database.insertAsync and a callback function. In this callback function there is a Database.SaveResult.getId() to indicate the reference to the record just created and stored in SFDC.

Would need a referencefield as part of the insertAsync method() to return this value again as part of Database.SaveResult.

Anyone a clue how to do this? The returned id in the callback cannot lead me back to the original inserted rows.

 
I have created several External Objects and am accessing in several Apex classes. How do I create test coverage for the External Objects without setting the SeeAllData to true? Is there a mock class to use? 
When requesting the version of a package that runs, we can use the system.requestVersion() with MinorVersion, MajorVersion and Patch

This last one does not seem to give any other results than null, even in a pach-dev and in a pusched version.

Is there any hidden trick, or is this function not working?
Any help is welcome
I create large amounts of feeds (via groups) including a pdf-file. Works fine.
I need to delete the old feeds and files permantly with apex in a backgroud-process. I manage to delete the feeds itself

delete [SELECT id FROM CollaborationGroupFeed WHERE xx LIMIT 1000];

and they are gone, but the files stay behind occupiing space and they need to go as well.

Cannnot find the right spot to do this.
I am looking for a solution to send a personal message to one specific user.

Now i use in a trigger
<cut some lines here>
ConnectApi.FeedItem feedItemRep = ConnectApi.ChatterFeeds.postFeedItem(Null, ConnectApi.FeedType.UserProfile, UserId, BinSegment);

and the message is forwarded to the user as indicated in UserId.

BUT

If an user starts following another user, he/she gets all messages from the other.

How can i force the message to be send to that one user only !

Hi everybody,

 

The users can populate a text area with free email addresses.

I put them in a list (I suppose they have put ";" as a separator between each elements)

 

How can I check each one is a valid email address ?

 

Here is my code :

 

 

// add user free field to  the list of emails	 
 if (closedRequest.Others_email_addresses__c!= null) { 	

list<string> lEmailOthersAddressesList = closedRequest.Others_email_addresses__c.split(';', 15);

for(String sOthersAddresses : lEmailOthersAddressesList){
lEmailAddressesList.add(sOthersAddresses);
System.debug('valeur de lEmailAddressesList = ' + lEmailAddressesList);
}
}

 Is it possible to test sOthersAddresses to see if it is a valid address email ?

 

Thanks for any help !

Marie

 

  • March 24, 2011
  • Like
  • 0