Mendix Retrieve last input value - mendix

In mendix i have 2 pages: Course Overview and Course_newEdit.
As the names suggest overview i the overview page and the second one is edit page.
The entity name is Course.
Its attributes are: Name String and Description String.
I have a requirement that i when a user edits course, the default value for name should be the last user input value.
So if the user has give first course name as History.
The second time any user tries to input the name, it should by default show History.
how can this be achieved?
I couldn't find any option for the same in the default settings.
Mendix 9.2 pro

If you are editing an existing course than it will automatically show the value that was last stored in the database so you don't need to do anything there.
If you are creating new course and want the default value of 'Name' attribute to be automatically filled in using the previous course object, than you have to retrieve last saved course object from database with range option = 'First' and add sort property that can identify the retrieve object as last saved course object. Than you can use retrieved last saved course and copy 'Name' to your new course object.
Please check out Mendix Forum and Mendix Slack Community if you have more questions.
Mendix Forum: https://forum.mendix.com
Community Slack: https://join.slack.com/t/mendixcommunity/shared_invite/zt-hwhwkcxu-~59ywyjqHlUHXmrw5heqpQ

first you need to retrieve the list "Course" from database then sort the list by creating date descending then retrieve head of the new sorted list then fill this object in the new created one
course/name

Related

How to use Get Record to lookup a related record on another object when I don't have the schema Entity Name - Just the LogicalName

All,
I am building a Power Flow. I am returning an object that has a relationship to another entity.
I want to get some values from the related entity.
I am attemping to use the "Get Record" connector. The returning object returns just the logicalEntityName (in this case "opportunities") but Get Record wants an Entity Name that is the Schema Name ("Working Opportunities").
Big Question: What's the secret to use CDS to get information from a related record in another object?
Little Question: How do I do get the Schema Name?
The logical name will be the same as schema name except some casing difference, ie schema name will have camel casing (first letter of first/second word with capitals, you can notice it clearly in custom entity which will have publisher prefix like new_entityname) and logical name will have pascal casing (all lower case).
You can find the details in XrmToolBox metadata browser or in Solution.
In the below snip, (Logical) Name = Opportunity and Schema Name = Opportunity, also Display Name can be anything and can be changed anytime.
Regarding the related entities, you should use List Records: GetItems_V2 and you can use filter by passing parent record to get related child records. Read more
Could you please share flow screenshot and response to help you with your requirement?
As suggested by Arun you could use List Record and filter query to pass parent record id which will be available from dynamic content.
see below link.
https://crmkeeper.com/2019/08/31/cds-list-records-filter-query-using-flow/
Please mark my answer verified if i were helpful

How do I store static data in Laravel?

In our application we will give titles to users based on their points. So, if a user has 10-99 points, that user might get the "Novice" title, but a user with 100-199 points might get the "Regular User" title. I plan on eager loading a user's points using an attribute and relationship, and once I have those points I will use an attribute method to assign the title.
But how do I get the list of possible titles?
I could make a model, a migration, and a seed file, but I feel like these titles won't change much and certainly would never need to be updated in an API call. I could also hardcode an array of points and titles and do a quick lookup to see which title belongs to a user, but then I need to somehow deliver those titles to the user in an Attribute method. Or I could store them in a repository or the cache.
Can I access a repository from within a model? Is it better to store this sort of data in a DB anyways, regardless of how often it's updated or queried?
You could use entries in your .env file to store the entries and then use some logic in your php to select the correct .env entry.
LEVEL_1_TITLE=Novice
LEVEL_2_TITLE=Regular
...
if($user->points < 99){
$title = env('LEVEL_1_TITLE');
}
...
Or do the same thing from an array in a class that you create and just select the correct array entry based on the points.

Show Order ID in Dynamics CRM Order Look up instead of Order Name

In Dynamics CRM 2016 (on-prem), I've custom child entity Partiesthat have a look of type order. Currently it is working properly and it is showing order name but I want it to show Order ID.
I tried to resolve by creating my own view, adding order id field only and making it default view for the look up but it don't meet my requirements.
This is controlled by the lookup view for Orders. The first three fields in the lookup view are shown when selecting records from the lookup field.
You cannot change the position of (or remove) the Name field from the lookup view. That still leaves you with two additional fields to be shown, one of which could be the Order ID.
I know no supported ways around this (except creating a workflow to copy the Order ID to the Name field and adding a custom name field instead, if you really insist).
Changing what appears on the form after you make a selection in a lookup field is not possible, unfortunately. The primary attribute is always what gets displayed after a user specifies a lookup value (which, for the Order entity, is the Name attribute). As Henrik's answer mentions, people commonly get around this by copying the value they want to see into the primary attribute using a workflow or a plugin.

Joomla Component Dynamic Custom Field based on other Field Value

I am creating a new Joomla Component. I am able to create custom fields for the component backend forms - but I am not able to create Dynamic Custom Fields.
What I would like to do is have a field that is dynamical populated based on the value of a previous field. The easiest way to explain this is the simple country,state,city breakdown.
Field 1 = Country
Field 2 = State (Based on what the user selected as as Country in Field 1)
Field 3 = City (Based on what the user selected as State in Field 2)
The fields would of course need to be refreshed, reset as the user picks a different country etc.
The data to populate the fields would also all need to come from a database based on the previous fields value.
I am guessing this needs to be done via ajax or javascript or something? But wondering if there is an official way? Especially since there are database calls involved.
Please let me know if there is anything I can explain better..
David
I ended up just creating text fields but then validating the input to make sure the values added are correct.

Getting Document Collection in Lotus Notes using the Form UNID

I have the UNID of a Lotus Notes form. can i use this UNID to get the Document Collection of that form ??
I am using the NotesDatabase.Search() method to get the document collection. But this query only works if it is provided with the Form Name. Does not works works with the Form UNID.
I am trying to do this because in my application there are two forms with the same name and Alias name.
Short answer: This is NOT possible.
Documents are linked to the Form via their own Form- item. This is a textitem and contains the alias of the form they were created with. There is NO further relation between the form that was "really" used when creating a document. As soon as you create another Form with that alias and delete the old one, all documents will use the new one. As long as there are 2 forms with the same alias, one of them will be used by chance (usually the one with the smaller NoteID will be used, but this can not be guaranteed).
If your question is to find out, which documents where created with which of the forms the only possibility is to select them according to special fields in the forms. If e.g. one form has an item "CreatedDate" and the other does not, then you could select #IsAvailable( CreatedDate )
Unfortunately if you open a document that was created with the "old" form and save it, it will also have the new item... So this will never be a 100% solution.
To make it even harder: One could create a document using LotusScript and in the end just fill the Form- item: doc.Form = "SomeForm". Then the document was not created with either of your two forms...

Resources