• James Gauci 7
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
Hi all, I have a problem regarding Apex Code in flows. I have this flow that's sole purpose is to create an entity (Notice in this case) using the variables passed to it. Up to the creation of the entity, the flow works perfectly.

However now we require the system to redirect to the created entity at the end of the flow. After having done some research on the subject, we created a lightning resource in order to do this functionalty. Below is the code of this lightning resource:

Component Part:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,lightning:availableForFlowActions,lightning:availableForFlowScreens">
	<aura:attribute name="recId" type="String" />
</aura:component>
Controller Part:
({
    invoke : function(component, event, helper){
        console.log(component.get( "v.recId" ))
        $A.get( "e.force:navigateToSObject" ).setParams( {
            "recordId": "a021j000002DBCNAA4",
            "slideDevName": "related"
        } ).fire();
        
    }
})

Design Part:
<design:component>
    <design:attribute name="recId" label="Id of the record" />
</design:component>
 We left the remaining components as default or empty. Following this code, which should take the ID of the created notice and navigate to it, we added an action to this flow that calls this code. The following are images of the flow and action:
Image of full flowImage of action

Primarily we tested the action in the debugger, and the function seemed to work properly, with no errors coming up and the notice being created. Also it seems that the notice ID of the newly created notice is being passed successfully into the flow. However, when the flow was tested in the sandbox directly, a generic error pops up as shown below:
User-added image
Sorry for the Italian, but basically it simply tells me that an error has been found in the flow, and that i need to contact the administrator. Can someone advise on what we could be doing wrong? Thanks.

 
Hi all, I have a problem that regards predefined fields in Event creation Action.

Currently, the action that creates the event (in this case named 'Stipula Atto/Contratto') has 2 predefined fields. One is the 'Nome' or Name field, which is the preset WhoId field, and the other is custom field called 'Venditore'. These can be see in the image below:
Image of Predefined Fields
Both of the fields hold references to a Contact. The problem is, we want the value currently being predefined in the 'Venditore' fields to be concatinated to the 'Nome' field. 

We've already attempted concatinating both formulas into the 'Nome' field, however the following error arrises when this is done: 

Error: The data type of the formula result (Text) is not compatible with the expected data type (Search (Lead, Referent)).

This is shown in the image below:

Error for concatination

I understand that the error explains that concatination parses the reference into text, so I would like to know how to concatine 2 contact reference into 1 field, while keeping both references as actual contact references.

I'm assuming it is possible to add multiple contacts into the WhoId field because it is already possible to add multiple contacts into the field manually when creating the activity. Can anyone point me into the right direction about how to solve this problem? Thank you very much.
 
Hi all, I have a problem regarding Apex Code in flows. I have this flow that's sole purpose is to create an entity (Notice in this case) using the variables passed to it. Up to the creation of the entity, the flow works perfectly.

However now we require the system to redirect to the created entity at the end of the flow. After having done some research on the subject, we created a lightning resource in order to do this functionalty. Below is the code of this lightning resource:

Component Part:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,lightning:availableForFlowActions,lightning:availableForFlowScreens">
	<aura:attribute name="recId" type="String" />
</aura:component>
Controller Part:
({
    invoke : function(component, event, helper){
        console.log(component.get( "v.recId" ))
        $A.get( "e.force:navigateToSObject" ).setParams( {
            "recordId": "a021j000002DBCNAA4",
            "slideDevName": "related"
        } ).fire();
        
    }
})

Design Part:
<design:component>
    <design:attribute name="recId" label="Id of the record" />
</design:component>
 We left the remaining components as default or empty. Following this code, which should take the ID of the created notice and navigate to it, we added an action to this flow that calls this code. The following are images of the flow and action:
Image of full flowImage of action

Primarily we tested the action in the debugger, and the function seemed to work properly, with no errors coming up and the notice being created. Also it seems that the notice ID of the newly created notice is being passed successfully into the flow. However, when the flow was tested in the sandbox directly, a generic error pops up as shown below:
User-added image
Sorry for the Italian, but basically it simply tells me that an error has been found in the flow, and that i need to contact the administrator. Can someone advise on what we could be doing wrong? Thanks.

 
Hi all, I have a problem that regards predefined fields in Event creation Action.

Currently, the action that creates the event (in this case named 'Stipula Atto/Contratto') has 2 predefined fields. One is the 'Nome' or Name field, which is the preset WhoId field, and the other is custom field called 'Venditore'. These can be see in the image below:
Image of Predefined Fields
Both of the fields hold references to a Contact. The problem is, we want the value currently being predefined in the 'Venditore' fields to be concatinated to the 'Nome' field. 

We've already attempted concatinating both formulas into the 'Nome' field, however the following error arrises when this is done: 

Error: The data type of the formula result (Text) is not compatible with the expected data type (Search (Lead, Referent)).

This is shown in the image below:

Error for concatination

I understand that the error explains that concatination parses the reference into text, so I would like to know how to concatine 2 contact reference into 1 field, while keeping both references as actual contact references.

I'm assuming it is possible to add multiple contacts into the WhoId field because it is already possible to add multiple contacts into the field manually when creating the activity. Can anyone point me into the right direction about how to solve this problem? Thank you very much.