How do you create an object which meets certain criteria of another object?

I have two entities. One is a customer and the other one is an order. A customer has a certain amount of credits and an order costs a certain amount credits. When making an order object i want to pass the customer object and check if the customer has sufficient credits. Only then i want to commit the order. What i've come up can be seen in the the image.  Unfortunately this does not work, i did look up the error, but im still clueless. Is there someone who can help me?   the decision node contains the following expression:
3 answers


Your check seems fine. The error states something different: it means that this microflow (triggered from on a page) doesn't have the Klant object. 

So you have two options:
1: Make sure you pass the correct Klant object from the page to this microflow.

2: Remove the microflow parameter, and retrieve the correct Klant object from your database.





Hier onder staat de pagina waar de microflow aan gekoppeld is.



Hi Quincy,

Although I'm also Dutch, I will answer this question in English for the benefit of the community.

The issue here, is that when you press the save button, you are currently looking at an Orderbon (order). This object is passed to the microflow as a parameter, as you can see in the microflow settings of the save-button.

However, although the order is linked to a customer, the customer object itself has not been retrieved for the client and can therefore not be sent to the microflow as a parameter.

The solution however is very simple. Instead of having 2 input parameters in your microflow, remove the Klant (customer) parameter and perform a retrieve-over-association action as your first action in the microflow. In this retrieve, you can select the customer from the association with the order, which will make sure that you have the customer information available in the rest of your microflow.

You could take a look at the rapid developer learning path (especially sections 7.5 to 7.7). This explains the scope and how retrieves will get you the objects that you need.

Good luck,