Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 82411

Setting a default Attribute value of an entity

$
0
0

Hello here,

I'm new to Mendix and doing some experimentation with my first Application - a simple HelpDesk Request management system.

The idea being that a user opens a page to create a new request.  Fills out some data - username, phone number etc. and a new request is created.  So far so good.  Aside from storing details of the Request in various tables, I also have a table which stores the possible Status a request may have - New, In Progress, Completed and so on.  Obviously, I want new logged Requests to be created with the Status of New.

I couldn't find a way to set the Entity Selector to do this for me by default, to avoid the user from having to select the New option.  Is this true - can this not be done via the form directly?

Next I tried creating a Microflow, to override the standard Save button on the form.  On the form is an invisible Entity Selector for the RequestStatus

So my actions are:

  • Retrieve RequestStatus from the form via the Association (a null value at this stage, as the user hasn't selected a value)
  • Change Object - update RequestStatus(StatusName) to 'New'
  • Commit the new Request Object to the database
  • Close the form

 

The Microflow fails at runtime with the error:

com.mendix.modules.microflowengine.MicroflowException: requirement failed: Change object 'RequestStatus' should not be null
	at RequestManagement.SaveNewRequest (Change : 'Change 'RequestStatus' (StatusName)')

 

So I seem to be stuck, as I can't seem to update the Status without it being set first, which is exactly what I was hoping I would be able to do from the form!

It seems like such a simple thing and I'm sure there are lots of ways to achieve this.

Any ideas for me?

Many thanks,

David

 

 


Viewing all articles
Browse latest Browse all 82411

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>