To resolve the error, you will need to create a request status object instead of updating it...since you can't update and empty object. So use a Create action instead of the Change action, set the status to New and set the association to the request object so you can retrieve it as needed. If you know the request status is empty, no need to retrieve it.
Hope that helps.
***Edit***
I created this domain model:
I then created a simple microflow which receives a Request object as a parameter and creates a new RequestStatus object. See screen shot below:
The yellow highlighted member sets the Association between the new RequestStatus and the Request.
Let me know if you have any other questions.
Can you set a default value for the attribute Status?
go to your domain model. Click the attribute and at the bottom you can set a default value.
I thought I'd cracked this but I was too hasty.
This is the order of my Microflow:
The problem is - this is adding new (duplicate) status's to my Status table. Not the desired behaviour. I've also tried Deleting the new Status name object before the commit is made, but this means that the Status for the main Request object is not stored.
Any help would be gratefully received!
Hi David,
It sounds like you have an entirely separate entity called requestStatus that you use to hold the status of the request. What you should do is create an attribute on your Request object named 'requestStatus' and have it be an enumaration (link). Create a new Enumeration called requestStatus with the three values (New, in Progress, Completed) and then set New as the default value for your attribute. Enumerations give you lots of power to drive data retrieves, filtering, and page layouts. It also and ensures that you don't end up with a host of 'requestStatus' entities that fill up a table with duplicates. Enumerations is the best-practice way to accomplish what you want.
So to complete your use case, you should:
1) Create an attribute on your Request object of type 'Enumeration'. Call it requestStatus
2) Create a new Enumeration called requestStatus that contains your three desired values. Link your requestStatus attribute to this enumeration.
3) Set the default value for the requestStatus attribute to be 'New'
Now when you create a new request, the status should already be set and you don't have to mess around with a separate entity or a string and things will be much cleaner.
Let me know if this makes sense or if I should add some pictures.