What feature need to be enabled for entities filtering on Jhipster? - jhipster

What those words "When this feature is enabled" on this documentation http://www.jhipster.tech/entities-filtering/ refer to ?
My jdl file is OK (thanks for the recent implemenattion : https://github.com/jhipster/generator-jhipster/issues/6286 )
Command jhipster import-jdl my_jdl_file.jdl work well.
But, I don't know what refer to "this feature" so it doesn't work (with swagger or postman).
Thanks

If you want to enable filtering in JDL you have to:
Use the filter keyword
Your entities must use a service class or implementation.
The sample JDL below will create the filter classes for entity A:
entity A
entity B
filter * except B
service * with serviceClass
If you generate your entities through the prompts, make sure to enable Service Class and Filtering options.
As an example with a Foo entity, in your foo.component.ts, you can add keys to the query object to filter on those fields:
this.fooService.query({ 'id.equals': 953 })
JDL Docs
Entity Filtering Docs

Related

How to remove Required field from an entity in Jhipster

I am new to Jhipster and I want to remove required field from column without changing anything else like
table name in h2 db or the names of the columns in that table. I tried to remove #NotNull annotation from entity name and set field in database to null but when i run integration test using
mvnw verify i get this error
EmployeeResourceIT.checkCompanyIsRequired:124 Status expected:<400> but was:<201>
Thank you in advance!
You must modify the EmployeeResourceIT test also so that it does not verify company requirement anymore.
It would be simpler to modify your JDL file to change the constraint on this field and import it.
And if you did not use JDL, you should learn it, it's more powerful than answering questions (see https://www.jhipster.tech/jdl/getting-started)
You can create your JDL file from your existing project using jhipster export-jdl

soapClient.GetList does not return CustomFields, created in Acumatica I300 course

Acumatica course I190 shows how to create custom fields. I followed the tutorial and created two custom fields for Stock Items.
Acumatica course I300 has an example of exporting StockItems, procedure RetrievalOfDelta.
However, call soapClient.GetList(stockItemsToBeFound) does not return the CustomFields, even though I changed ReturnBehavior = ReturnBehavior.All, and can see values of all other fields.
How to include the CustomFields to be returned by GetList?
Thank you.
For guidelines on broad general topics like API Custom Fields refer to documentation.
You need to extend the default endpoint and extend the entity (stock item).
Reference:
https://help-2020r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=c450492e-06fe-4563-95c3-efa76975415b
Use populate action to add custom fields to the extended entity.
Reference:
https://help-2020r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=bd0d8a36-b00b-44c8-bdcd-b2b4e4c86fd0

Update the Jhipster User entity

I use jhipster and I would like to modify the User entity and add fields and relationships.
I use jhipster entity user and this command is not good.
How can I do it?
User is not a JHipster entity, the generator does not manage it. You must edit the code manually or add a related entity where you put additional fields, see doc: https://www.jhipster.tech/tips/022_tip_registering_user_with_additional_information.html
If you encounter a problem where you need to alter the User entity, Its recommend not doing that. Modifying this default entity might break your app depending on the nature of the changes.
Instead, there are other available solutions like:
creating an entity composed of the User entity
extending the User entity
Using composition
by using OneToOne relation like this
entity ApplicationUser {
additionalField Integer min(42) max(42)
}
relationship OneToOne {
ApplicationUser{internalUser} to User
}
Or
Using inheritance
This solution does the same thing as the previous one, but isn’t as straightforward as the first one because you need to:
create a new entity by hand,
adapt the code to make it use this new entity,
potentially manage yourself the database migration to persist this new entity (depending on the nature of the changes).
More info: https://www.jhipster.tech/user-entity/

How to change the display field to use when use jdl?

When use jhipster entity generator by console a question like follow allows to change the display field on frontend:
When you display this relationship with AngularJS, which field from
'user' do you want to use? (id)
It is possible to make the same with jdl?
Edited
Ok, It appears that nobody has this problem, or maybe there aren't anybody in home?
So, I'm going to explain it. Let's suppose this scenario:
Create two (or more) entities with relationship with the console.
Choose a different field from id to manage the front-end.
Test the project (it works fine).
Export the model to jdl file
Import the jdl file, with no changes, in another new project.
Boom! The UI comes back to Id reference.
Is there any option to resolve it, or is this resolve in other tools like uml import? Future plans?
Resolved
Reading the documentation in detail, I've found a solution:
"Declare the field you want to use to display a relationship in AngularJS.
To do that you must add the field name between () after the injected field name."
Resolved
Reading the documentation in detail, I've found a solution:
"Declare the field you want to use to display a relationship in
AngularJS.
To do that you must add the field name between () after the injected
field name."

CRM Restkit oData call to retrieve custom entity's value in crm 2011

In crm 2011, in an entity I have to retrieve the first name field from a custom entity through CRM Restkit.
I am getting an error when I run the code.
I think the 'filter' is wrong.
If it is system entity, then filter = "ContactId eq guid'"+Xrm.Page.data.entity.attributes.get('xyz' ).getValue( )[0].id+"'";
works fine.
But my case it is a custom entity with schema name 'new_student',
I tried the filter = "new_student/Id eq guid'"+Xrm.Page.data.entity.attributes.get('xyz' ).getValue( )[0].id+"'";
which is not working.
So what should the filter be in my case
Regards,
Vickram
You probably should not use the entity name as the prefix in the filter, 'new_student/Id'. But that being said, I would suggest you "debug" this problem in few steps.
Start by opening the "new_student" JSON feed URL at the JSON endpoint to see that everything is valid for your custom entity through the web services, like:
http://yourCRMServer/YourInstanceName/2011/OrganizationData.svc/new_studentSet
Just replace the CRM server URL and instance name.
When you get this path working and you see "results", continue adding the filter to the URL helping you to identify the field name and finding the correct filter faster:
http://yourCRMServer/YourInstanceName/2011/OrganizationData.svc/new_studentSet?$filter=Your_Schema_Field_Name eq 'Johnson'
and so on, then if you only need the first name you should add that to the $select to minimize the load of data coming from the JSON web-service:
http://yourCRMServer/YourInstanceName/2011/OrganizationData.svc/new_studentSet?$filter=Schema_Field_Name eq 'Johnson'&$select=FirstName
Hope it helps.

Resources