Closed hansbak closed 4 years ago
That's because it's coming from the cache and cached queries always select all fields from the database otherwise a different cache entry in memory would be needed for every combination of selected fields. Usually this doesn't matter because when doing cached finds you want all fields anyway.
If you really want the entity facade to limit the results then use cache="false" but then you'll also always be hitting the database. For runtime performance and DB load better to transform/filter the data yourself.
On Thu, Jul 16, 2020 at 1:11 AM Hans Bakker notifications@github.com wrote:
when i implement a REST interface taking advantage if the JSON in/output by using the screen file with a transition, i need to be able to select the fields required, because often too many fields are supplied......
my screen file:
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-2.1.xsd" require-authentication="false" track-artifact-hit="false" default-menu-include="false">
<transition name="testing" method="get" begin-transaction="false"> <service-call name="servicefile.getCurrencyList" web-send-json-response="true"/> <default-response type="none"/> </transition> <widgets><!-- this should never be viewed... --></widgets>
my services file:
Get currency list for registration. the shortened output:
{ "currencyList" : [ { "description" : "Bitcoin", "uomId" : "BTC", "lastUpdatedStamp" : 1594365110959, "abbreviation" : "BTC", "uomTypeEnumId" : "UT_CURRENCY_MEASURE" }, { "abbreviation" : "CRC", "uomId" : "CRC", "description" : "Costa Rica Colon", "lastUpdatedStamp" : 1594365110959, "uomTypeEnumId" : "UT_CURRENCY_MEASURE" }, { "abbreviation" : "COP", ...................
Regards Hans
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/moqui/moqui-framework/issues/427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFEVUJ6GRU2I5RK6F722TTR32YZVANCNFSM4O3ZCKOQ .
Thanks for your quick reply. However that fact (caching) makes this method using transactions uninteresting. Currently i am using jsonslurp on input and the creation json on output myself using the REST resources calling of services. Regards, Hans
when i implement a REST interface taking advantage if the JSON in/output by using the screen file with a transition, i need to be able to select the fields required, because often too many fields are supplied......
my screen file:
my services file:
the shortened output:
Regards Hans