How to retrieve one data with QueryEntity and queryfilter

Hello,
I have a problem that can not be solved.
I have to make an expression rule with a reading
to my cdt "docs" and filter their fields to catch only
the field "id" and with that value put it in the field "idsolic"
from my other cdt "solic". I do not know how I should do it


with(
local!query: a!queryEntity(
entity: cons!CPRO_CT_DS_docs,
query: a!query(
filter: a!queryFilter(
field: "id",
operator: "=",
value: ri!idSolic
)
)
),
local!query
)


Thanks

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    What do you mean by:

    put it in the field "idsolic"

    A query can't "put" data somewhere else - you might be describing a 2-step process except i'm not completely clear on what you're actually trying to do, so could be misunderstanding something.

  • I have solved part of the problem. I enter the value in test rule:
    Rule Input Name
    doc (Text)
    Expression
    "[Document: 7917]"
    Value
    "[Document: 7917]"

    with(
    a!queryEntity(
    entity: cons!CPRO_CT_DS_docs,
    query: a!query(
    filter: a!queryFilter(
    field: "doc",
    operator: "=",
    value: ri!doc
    ),
    pagingInfo: a!pagingInfo(1,-1)
    )
    ).data

    Now with the value "[Document: 7917]" from the table "docs" It is necessary to recover the "id" associated with that document And entered in the field "idSolic" of the other cdt. but this in a script task
Reply
  • I have solved part of the problem. I enter the value in test rule:
    Rule Input Name
    doc (Text)
    Expression
    "[Document: 7917]"
    Value
    "[Document: 7917]"

    with(
    a!queryEntity(
    entity: cons!CPRO_CT_DS_docs,
    query: a!query(
    filter: a!queryFilter(
    field: "doc",
    operator: "=",
    value: ri!doc
    ),
    pagingInfo: a!pagingInfo(1,-1)
    )
    ).data

    Now with the value "[Document: 7917]" from the table "docs" It is necessary to recover the "id" associated with that document And entered in the field "idSolic" of the other cdt. but this in a script task
Children
No Data