How to Determine the Field Name for Use in Groovy API Methods
When performing a search using, for example, the api.find
method:
api.find("Q", 0, 100,"targetDate",["quoteType"])
it might happen that an error like this is thrown:
NewElement : ERROR(@1): org.hibernate.QueryException: could not resolve property: quoteType of: net.pricefx.domain.Quote [select _it.quoteType from net.pricefx.domain.Quote _it where _it.isDeleted!=:p1 order by _it.id asc NULLS FIRST]
It means that quoteType
field has not been found.
The reason is that there is a difference between map representations of domain objects (what is returned by api.find()
), and doing a search in the database (what are the actual columns/fields that are available to filter in api.find()
). Therefore, quoteTypeUniqueName
instead of quoteType
must be used in the method.
To determine the field name that can be used in the Groovy method to search or filter fields, please refer to the following table:
Field name as used in the UI, or returned by | Field name in the database (use this name to search, or filter fields) | Table |
---|---|---|
quoteType | quoteTypeUniqueName | Q |
supersededBy | supersededByUN | Q |
prevRev | prevRevUN | Q |
sellerName | seller.sellerName | RBA |
rebateType | rebateTypeUN | PYR, RR |
headerRebateType | headerRebateTypeUniqueName | RBA |
customerGroup | customerGroup.customerFieldValue | Q |
productGroup | productGroup.productFieldValue | CT, RR |
nodeId | id | C |
changeRequestId | changeRequest.id | DCRI |
compensationHeaderType | compensationHeaderTypeUN | CO |
compensationConditionType | compensationConditionTypeUN | COLI |
contractTermType | contractTermTypeUniqueName | CTLI |
Filtering “typedId” with api.find/api.stream
It is not possible to filter results by typedId
using these search methods at the moment. There is a workaround available to build the typedId
– you can fetch id
of the column and concatenate it with the type code of the object (for example, "${objectId}.Q"
) so you will get the typedId
(={objectId}.{typeCode}).
Found an issue in documentation? Write to us.