• ZAPEX
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies
I am using Flow to run an API call to an external system that in turn return a record structure, One of the records fields is a datetime field type. When I try to access the record datetime field in a screen element (or any other element) I am getting  the below error
 
class java.util.GregorianCalendar cannot be cast to class moduleapi.interaction.DateTime (java.util.GregorianCalendar is in module java.base of loader 'bootstrap'; moduleapi.interaction.DateTime is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4ee37ca3)

below is the Apex Action I use. The Action save its output into an account record variable and then after if I try to access the datetime__c field I get the class java.util.GregorianCalendar error I reported above.Why? if I use date instead of datetime it works. If I initiate the datetime__c like this it works out.acc = [select name, datetime__c from Account where id ='0014J000004uVIUQA2'];

driving me nuts.

global class datetime_issue {

@InvocableMethod(label = 'datetime_issue')
global static list<outputCls> getAccounts() {

outputCls out = new outputCls();
out.acc = new account();
out.acc.datetime__c = system.now();
out.acc.name = 'datetime issue';


return new list<outputCls>{out};
}

global class outputCls {

@InvocableVariable
public account acc;
}
}
I currently have an invocable method being called by a flow. the invocable method return a List<List<String>> in order to send back a list of options, in this case paper types, in a specific order. The flow gets this list returned as a Collection, but I need it to be a dynamic list of options.

Does anyone know how to convert the Collection to this or have my invocable method return this type to the Visual Workflow?
Hello all , I have a situation in which an agent is getting work emails to his private inbox and he would like to forward them on behalf of the customer to salesforce and to create new case. The problem is that if the customer forwarding the case to the support inbox which has a redirect rule that redirect emails to salesforce email2case address the new created case web address is the agent and not the original mail sender (the customer). This causing afterward an issue to set the contact on the case.
Any idea how we can get the original sender to show on the case and not the agent who did the forwrading on his behalf?
Same situation works perfect on desk.com. 
I have a web service callout that is workign fine, but I cannot get the tests working for it.  The ws has two methods; init() and sync().  init() returns a String ans sync() returns List<String>

When I try to mock the response for the two WS methods in my test method, I get a an error:
Collection store exception putting myWS.syncResponse_element into MAP<String,myWS.initResponse_element>

So, it is trying to put one methods response into the response map of the other method.  

The WebServiceMock class looks like this:
@isTest
public class myWSMock implements WebServiceMock {

   public void doInvoke(Object stub, 
			Object request, 
			Map<String, Object> response,	
			String endpoint, 
			String soapAction,
			String requestName,	
			String responseNS, 
			String responseName,	
			String responseType) 				{
			
	myWS.initResponse_element r1 = new myWS.initResponse_element();
	myWS.syncResponse_element r2 = new myWS.syncResponse_element();
	r1.initReturn = 'response1';
	r2.syncReturn = new List<String>{'response2'};
	response.put('response_x', r1);
	response.put('response_x', r2);		
   }
}

I also tried structuring it with multiple mock response classes, one for each type of response, but I still get the Collection Store exception.

Thanks for your help.