• Óli Þór Gunnarsson
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
We have a customer wanting to implement Electronic Id authentication for their customer portal. We have tried to setup authentication according to the documentation here: https://help.salesforce.com/s/articleView?id=sf.sso_provider_openid_connect.htm&type=5

But we are facing issues with the authentication provider that states that we need to have support for PKCE, so the request contains the code_challenge and code_challenge_method parameters.

I have had no luck to find information about how this is done and if it possible. I can not see this in the Auth provider setup. Can someone tell me if this is possible and if so lead me to how it is done ?
 
Hi all,
 
We are using Platform events and trigger on platform event as subscriber. Test Class for one of several Event triggers is now generating error.
 
We used to have several functions in one Apex test class and only one of the functions has errors. I tried removing that function to separate apex test class and then the others run successfully but this one is still not working.
When we run the test it generates error with the message: "Failed to run tests synchronously.: java.lang.reflect.InvocationTargetException".
 
Lines causing error: "Test.getEventBus().deliver();"
 
I have had hard time to find information about what might be causing this...
Hi,
I am implementing sync between Salesforce and another system.
When Account is updated in Salesforce I need to call web service to update the account in the other system.

For this, I have trigger on Account after update that gets the fields being changed, builds json string from that and calls future method that does the callout.
This is all no problem but I want to make sure that the change is done all the way. (I am responsible for this until I get handshake back from the web service)
What can happen in the future method is that the web service callout gives me timeout, I can receive other response codes than 200/201 etc.

How can I monitor this callout and for example try again if I get timeout, notify the user etc ?
Hi,

I have custom object called Transaction__c, that object has Lookup to Account and date field. I need to select the Id from Transaction__c if there are more than 3 with the same Account.

I can do this in 2 seperate SOQL statements but would like to do it one.
Here is the method with 2 statements and for loop:
List<AggregateResult> res = [SELECT Account__c, COUNT(Id) FROM Transaction__c GROUP BY Account__c HAVING COUNT(Account__c) > :TRANSACTIONS_TO_DISPLAY];
        
        List<Transaction__c> TransactionsToDelete = new List<Transaction__c>();
        
        for(AggregateResult  ar : res){
            
            Id accId = (Id)ar.get('Account__c');
            Integer NumberOfTransactions = (Integer)ar.get('expr0');
            
            // diff is the number of transactions to be deleted
            Integer diff = math.abs(TRANSACTIONS_TO_DISPLAY -NumberOfTransactions);
            
            List<Transaction__c> tmp = [SELECT Id, Account__c, Transaction_Date__c
                                  FROM Transaction__c
                                  WHERE Account__c = :accId
                                  ORDER BY Transaction_Date__c ASC LIMIT :diff];
            
            TransactionsToDelete.addAll(tmp);
        }
Is there a way to get the Transaction Id from one SOQL statement?
 
Hi all,
 
We are using Platform events and trigger on platform event as subscriber. Test Class for one of several Event triggers is now generating error.
 
We used to have several functions in one Apex test class and only one of the functions has errors. I tried removing that function to separate apex test class and then the others run successfully but this one is still not working.
When we run the test it generates error with the message: "Failed to run tests synchronously.: java.lang.reflect.InvocationTargetException".
 
Lines causing error: "Test.getEventBus().deliver();"
 
I have had hard time to find information about what might be causing this...
Hi all,
 
We are using Platform events and trigger on platform event as subscriber. Test Class for one of several Event triggers is now generating error.
 
We used to have several functions in one Apex test class and only one of the functions has errors. I tried removing that function to separate apex test class and then the others run successfully but this one is still not working.
When we run the test it generates error with the message: "Failed to run tests synchronously.: java.lang.reflect.InvocationTargetException".
 
Lines causing error: "Test.getEventBus().deliver();"
 
I have had hard time to find information about what might be causing this...
Hi,

I have custom object called Transaction__c, that object has Lookup to Account and date field. I need to select the Id from Transaction__c if there are more than 3 with the same Account.

I can do this in 2 seperate SOQL statements but would like to do it one.
Here is the method with 2 statements and for loop:
List<AggregateResult> res = [SELECT Account__c, COUNT(Id) FROM Transaction__c GROUP BY Account__c HAVING COUNT(Account__c) > :TRANSACTIONS_TO_DISPLAY];
        
        List<Transaction__c> TransactionsToDelete = new List<Transaction__c>();
        
        for(AggregateResult  ar : res){
            
            Id accId = (Id)ar.get('Account__c');
            Integer NumberOfTransactions = (Integer)ar.get('expr0');
            
            // diff is the number of transactions to be deleted
            Integer diff = math.abs(TRANSACTIONS_TO_DISPLAY -NumberOfTransactions);
            
            List<Transaction__c> tmp = [SELECT Id, Account__c, Transaction_Date__c
                                  FROM Transaction__c
                                  WHERE Account__c = :accId
                                  ORDER BY Transaction_Date__c ASC LIMIT :diff];
            
            TransactionsToDelete.addAll(tmp);
        }
Is there a way to get the Transaction Id from one SOQL statement?