Not able to create expression in Microflow

0
Hi Team,   I have one requirement in my project. I have added attributes in Domain Model like SNo with Datatype AutoNumber, Area and DocumentId attribute with String Datatype. I want to create expression: DocumentId = Area + "D" + SNo inside Change Object in microflow (Area will come from the form). I am facing one issue my AutoNumber attribute is not visible in dropdown and how can i achieve my requirement. Please help to resolve this issue.   Thanks & Regards, Akshay
asked
2 answers
0

Hello Akshay,

 

Autonumber is a non writable attribute, which is computed by the database.

 

see also documentation: https://docs.mendix.com/refguide/attributes/

 

A positive or negative whole number.AutoNumber attributes are automatically generated numbers. The default value of the attribute determines the first number that will be generated. Each created object will have an AutoNumber that is one greater than the previous one. AutoNumbers can only be used for persistable entities as the AutoNumber value is computed in the database.

 

So you can not set it yourself, however once it is set by mendix you can use it by using $yourEntity/SNo

 

Hope this helps

 

Good luck

answered
0

Hi Akshay,

 

What I understand from your explanation is, you want:

DocumentId = Area + "D" + SNo

 

In order to achieve this, in on change event,you can use the already created Autonumber type attribute to create a concatenated string of desired pattern.

 

Meaning: you will create an empty string variable at the starting of microflow ,followed by change variable activity which will have the pattern as mentioned above thus save and use it as DocumentID in further places.

 

answered