Quantcast
Channel: Mendix Forum Questions
Viewing all 83469 articles
Browse latest View live

Database Retrieval

$
0
0
Hi all, How to retrieve only the last record in a database? For retrieving the first object, there is a explicit option. But not able to retrieve the last object. Thanks.

Schedule event in Microflow scheduler shwoing error while executing microflow from java action

$
0
0
Hi guys, while running the schedule events , there is  java action in that schedule event microfow , in the respective java action i call one microflow while executing it its showing as mxobjects in null… while debugging from microflow i dnt get any current user and current session since its a schedule event…… after that i created one user and get the respective user context and pass inside core.execute since its showing context object is null……...   The below one is my piece of code….. if(!(boolean) Core.execute(context, "TcConnector.ShowLoginPage",params))   

Export Mapping requeris a parameter MQTT

$
0
0
Hi to all, I’m having a problem trying to publish a JSON file via MQTT, when I put the export mapping before the publish from mqtt, I’m not able to set up the parameter, and because of that my error appears “The export mapping requires a parameter but none is specified in the action.”. How can I solve this to be able to sendo my JSON file.

Using Mendix to create materials in SAP ECC 6

$
0
0
Hey all, Just started working with Mendix, and I really feel the energy flowing, because of all the ideas it gives us as an organization; so many ideas, so little time ;-) I was wondering if anyone here has experience using a Mendix App to create new materials in SAP using the OData connector in the Mendix Library, and more specifically whether it is possible to integrate also the creation of BOM and Routings.   Any experience is greatly appreciated ;-)

GROUP BY OQL Function DATEPART throws ConnectionBusRuntimeException

$
0
0
Hi there, I’m currently developing an abstract data layer. I use a custom Java Action for the data retrieves. I’m not sure if this issue is connected to the one I already created an issue for, but since I turned security off for the project I assume this must be something different.  We use a PostgreSQL database. I’d like to perform the following (working) query in postgres to be used in OQL in Mendix to retrieve the same data. This is the working PostgreSQL query: select date_part('WEEK', state_leaves_draft) as category, State as subcategory, count(State) as value from "requestfulfilment$request" group by category, subcategory and yields: [{ "category" : 45, "subcategory" : "Initiated", "value" : 3 }] This is correct and expected. Here an example OQL I performed which worked: select * from RequestFulfilment.Request yields [ { "Number": 97, "State_Leaves_Draft": "Tue Nov 05 22:17:25 CET 2019", "State": "Initiated", ... }, { "Number": 98, "State_Leaves_Draft": "Wed Nov 06 10:09:13 CET 2019", "State": "Initiated", ... }, { "Number": 102, "State_Leaves_Draft": "Fri Nov 08 09:49:58 CET 2019", "State": "Initiated", ... } ] There are more columns, but those are not relevant for this example. The data returned is correct. Here another OQL query which works select DATEPART(WEEK, State_Leaves_Draft) as category, State as part from RequestFulfilment.Request yields: [ { "part": "Initiated", "category": 45 }, { "part": "Initiated", "category": 45 }, { "part": "Initiated", "category": 45 } ] I also tested the `COUNT` function as well: select COUNT(State) as value from RequestFulfilment.Request yields [{"value":3}] Now, if I put this all together and use the group by the query looks like this: SELECT DATEPART(WEEK, State_Leaves_Draft) as category, State as subcategory, COUNT(State) as value FROM RequestFulfilment.Request GROUP BY category, subcategory   This query throws a warning and an exception: DataStorage_QueryHandling: - Executing query with old implementation due to detected exception in new implementation: No access rights for expression [category] An error occurred: com.mendix.connectionbus.ConnectionBusRuntimeException Message: 'requestfulfilment$request' is not a valid entity type. Stacktrace: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.connectionbus.ConnectionBusRuntimeException: An exception has occurred for the following request(s): InternalOqlTextGetRequest (depth = -1): select DATEPART(WEEK, State_Leaves_Draft) as category, State as subcategory, COUNT(State) as value from RequestFulfilment.Request group by category, subcategory at com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:386) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.connectionbus.ConnectionBusRuntimeException: An exception has occurred for the following request(s): InternalOqlTextGetRequest (depth = -1): select DATEPART(WEEK, State_Leaves_Draft) as category, State as subcategory, COUNT(State) as value from RequestFulfilment.Request group by category, subcategory at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:156) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.connectionbus.ConnectionBusRuntimeException: An exception has occurred for the following request(s): InternalOqlTextGetRequest (depth = -1): select DATEPART(WEEK, State_Leaves_Draft) as category, State as subcategory, COUNT(State) as value from RequestFulfilment.Request group by category, subcategory at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.connectionbus.ConnectionBusRuntimeException: An exception has occurred for the following request(s): InternalOqlTextGetRequest (depth = -1): select DATEPART(WEEK, State_Leaves_Draft) as category, State as subcategory, COUNT(State) as value from RequestFulfilment.Request group by category, subcategory at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:156) Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: An exception has occurred for the following request(s): InternalOqlTextGetRequest (depth = -1): select DATEPART(WEEK, State_Leaves_Draft) as category, State as subcategory, COUNT(State) as value from RequestFulfilment.Request group by category, subcategory at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) Caused by: An exception has occurred for the following request(s): InternalOqlTextGetRequest (depth = -1): select DATEPART(WEEK, State_Leaves_Draft) as category, State as subcategory, COUNT(State) as value from RequestFulfilment.Request group by category, subcategory at com.mendix.connectionbus.RequestAnalyzer.doRequest(RequestAnalyzer.java:63) Caused by: 'requestfulfilment$request' is not a valid entity type., exception occurred on mapping the following query: SELECT DATEPART(WEEK, requestfulfilment$request.state_leaves_draft, sun.util.calendar.ZoneInfo[id="Etc/GMT+1",offset=3600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]), State AS subcategory, COUNT(requestfulfilment$request.state AS subcategory) AS value FROM requestfulfilment$request GROUP BY category, subcategory at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.getMappedQueries(QueryMapper.java:276) Caused by: 'requestfulfilment$request' is not a valid entity type. at com.mendix.connectionbus.util.LegacyModel.$anonfun$getMetaObject$1(LegacyModel.scala:43) at scala.Option.getOrElse(Option.scala:189) at com.mendix.connectionbus.util.LegacyModel.getMetaObject(LegacyModel.scala:43) at com.mendix.connectionbus.DomainModelUtilImpl.getPersistableMetaObject(DomainModelUtil.scala:67) at com.mendix.connectionbus.DomainModelUtil$.getPersistableMetaObject(DomainModelUtil.scala:32) at com.mendix.connectionbus.DomainModelUtil.getPersistableMetaObject(DomainModelUtil.scala) at com.mendix.connectionbus.retrieve.query.mapping.MetaObjectInfo.getMetaObject(MetaObjectInfo.java:144) at com.mendix.connectionbus.retrieve.query.mapping.SelectColumnsMapper.getColumnLocation(SelectColumnsMapper.java:315) I also tried to GROUP BY column number instead of name, but this also didn’t work: SELECT DATEPART(WEEK, State_Leaves_Draft) as category, State as subcategory, COUNT(State) as value FROM RequestFulfilment.Request GROUP BY 1, 2 throws this: An error occurred: org.postgresql.util.PSQLException Message: ERROR: column "requestfulfilment$request.state_leaves_draft" must appear in the GROUP BY clause or be used in an aggregate function Position: 27 Stacktrace: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.basis.connectionbus.ConnectionBusException: An exception has occurred for the following request(s): InternalOqlTextGetRequest (depth = -1): SELECT DATEPART(WEEK, State_Leaves_Draft) as category, State as subcategory, COUNT(State) as value FROM RequestFulfilment.Request GROUP BY 1, 2 at com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:386) ---   A GROUP BY on a regular column works. A GROUP BY with multiple columns works as well. A COUNT works. … it seems everything by itself works, but you cannot GROUP BY an OQL Function column? Some more infos. My Java code: @java.lang.Override public java.lang.String executeAction() throws Exception { // BEGIN USER CODE IOQLTextGetRequest request = Core.createOQLTextGetRequest(); request.setQuery(query); IContext context = getContext(); IDataTable data = Core.retrieveOQLDataTable(context, request); return JsonSerializer.serialize(context, data); // END USER CODE } and the relevant portion of the serializer: IDataTable dataTable = (IDataTable) o; IDataTableSchema schema = dataTable.getSchema(); List<? extends IDataColumnSchema> columnSchemas = schema.getColumnSchemas(); List<? extends IDataRow> rows = dataTable.getRows(); List<HashMap<String, Object>> result = new ArrayList<>(); rows.forEach(r -> { HashMap<String, Object> map = new HashMap<>(); result.add(map); columnSchemas.forEach(c -> map.put(c.getName(), r.getValue(context, c))); }); return new JSONArray(result).toString(); (using Mendix v8.4.1)

Custom login doesn't work in cloud?

$
0
0
I allowed anonymous users and assigned Guest role for them. I created a custom Login page using Login Form widget and assigned role-based home pages for other users. Everything works fine in localhost, but after uploading to the cloud (hit Run) I still see the Mendix default login page. Why is it happening and how can I fix it?

Redirecting to a page in another tab

$
0
0
On the homepage, I want to enable the user to open a search page in another tab of the internet browser. This page contains a data grid in which the results of the search are reflected. I did the configuration according to what I came across on this forum. That is to say, I defined a URL for the mentioned page, see the image below (the extension {Id} is automatically generated by Mendix): Then I defined a non-persistent entity with an attribute URL that is a calculated field.  The URL is constructed in the following way (I substituted the {Id} with a 0 as to open the search page without any hits): Behind a button on the homepage, I invoke a microflow that creates the non-persistent entity and opens a pop-up window with the redirection widget: The timer is used to close the pop-up window after a millisecond through a microflow. The redirect widget is configured as follows: When I push the button on the homepage to open the desired page in a new tab, I get the following error: I don't know what I am doing wrong.  Any help would be appreciated to get this working. I would like to thank you in advance for your time and effort to help me.

Custom Login doesn't work in the cloud?

$
0
0
I allowed Anonymous users, assigned a Guest role for them and created a custom login page using Login Form widget. I also created role-based home pages for other user roles. Everything works fine in local, but after deploying to the cloud (by hitting Run button) I still see the Mendix default login screen. What could be the reason and how can I fix it?

New user sign-up

$
0
0
Hello colleagues, I would like to create log-in and sign-up page for my application, i.e. I woulf like to implement sign-up page. I do this by the following microflows (please, see the attcahed pictures), however, when I click to “New account” button I’m redirecting to “Sign-in” page. Could you, please, help me to resolve the problem? Thanks in advance, Anna            

How to transfer object from list view to line chart

$
0
0
Usecase:  On click of a machine name(Which is a button) a line chart data should be displayed. Scenario: There is a list view with list of machines in it and the line chart is listening to the list view. Now when a machine is clicked the graph doesn’t change. Same graph displays on click of any machine.   Any help is appreciated.! Thanks!!  

Learning XPath

$
0
0
Hey, do you use XPath in your Microflows and do you know a proper Site to learn XPath? I searched a lot but didn't find any good sites, even in the Mendix Documentation isn't very much except the basics. Thanks a lot in advance and have a nice Weekend ;)

Native mobile turn off landscape mode

$
0
0
Hi, Is there a way to turn off the landscape orientation on a native mobile app? I’d like to have my app only in portrait mode. Thx.

Pluggable Widgets: Custom CSS filename

$
0
0
Is it possible to specify a different CSS filename for pluggable widgets? As far as I understand, there is an implicit include of [WidgetName].css when a widget is loaded, but I would like to share a CSS file between a couple of widgets, which are both located next to it in my output, e.g.:   widgetFolder/ ui/ common.css widget1/ widget1.js widget2/ widget2.js Widget1/ Widget1.xml Widget2/ Widget2.xml How can I include common.css? Can it be set in the xml file of the widgets, or the package.xml?

Getting address based on latitude and longitude

$
0
0
Hi all, Is there any app or widget to convert latitude and longitude into address or location? Thanks.

Change object should not be null one more time

$
0
0
So, I am coming back one more time to the same subject (already asked in https://forum.mendixcloud.com/link/questions/97351). Now, I have used the following microflow to produce a global variable (= an entity with just one object):  https://stackoverflow.com/questions/55794490/how-to-declare-a-global-variable-in-mendix :  However, the change object action in the end “sees” only the “SOE_CabinetObject”, and not the “NewSOE_CabientObject”. That means that in case the “SOE_CabinetObject” is empty and the new one is created (“NewSOE_CabientObject”), it cannot be passed to change object action, so I receive an Error “Change object should not be null” once again….. How should it be done correctly..? 

I can't place a building block into a container.

$
0
0
Hi, I am doing the "Become a rapid developer (Analyst)” learning path, but now in module 4, I have to place a card action into the container. But when I try to place it in the container I get an error: “Could not add widget to the app. Something went wrong while initiating your widget. Please try again later...” I had this for a couple of days now and before that I didn't have any problems with it. I also can't put a Pageheader controls into a data view. Can someone please help me with this problem? Greatings, Bart.

Calculating Age from Date of Birth (Native Mobile)

$
0
0
Hi All, I am using Mendix 8.4.1 (Native Mobile View). How can we calculate age from date of birth. Thanks, 

Using OData many to many associations in Power BI

$
0
0
Hi,   I've managed to create charts in Power BI using OData from a Mendix app, but only when representing associations as associated object id's (which makes sense to me). However, if I want to use many-to-many associations, it's only possible to expose them if the associations are represented as links. I haven't figured out how to relate the objects (like this) in Power BI. Has anyone been able to achieve this?   Many thanks   Gonçalo

Odata: expose many to many relation not possible?

$
0
0
Hi all, I thought publishing OData is straightforward, but now I'm stuck. I just want to expose a *-* relation. I found this forum post from 2 years ago where the answer is: it's not possible. Is this still true? Is there a best practice or a workaround for this issue?

Groupbox Helper

$
0
0
How do I set the Groupbox Helper exactly?
Viewing all 83469 articles
Browse latest View live


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