Send FIND output to formatted query

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Send FIND output to formatted query

Post by PointsWell »

I think I know the answer to this question.

I need to check for the existence of some BOs and if there are some I need to then show those in a PICK ONE query. If there are no BOs then I want to just end the process with a REPORT ERROR message.

Is there a smart way to utilise the returns from the first FIND to then populate the PICK ONE query? Or am I going to be stuck with two searches for the same data?
nhofkes
Posts: 94
Joined: Mon Sep 07, 2020 6:03 am
Location: Netherlands

Re: Send FIND output to formatted query

Post by nhofkes »

A late reply to this question.
I am doing something similar, storing the results from the FIND into a temporary QueryParameters object and using that object to populate the PICK ONE OR MORE query.

Details:
The QueryParameters BO has 3 attributes:
  • ItemsCounter
  • LIRUID
  • Relationships (a pm reference to Relationship BO)
Main Process:

Code: Select all

CLEAN QueryParameters WHERE QueryParameters.LIRUID=LoggedInRegularUser.ID
CREATE QueryParameters WITH QueryParameters.LIRUID=LoggedInRegularUser.ID
QueryParameters.ItemsCounter=0
SelectRelationsWithoutAccount_1 USING Register, QueryParameters
If QueryParameters.ItemsCounter=0 Then DISPLAY MESSAGE 'All related persons of this entity already have an account for the register' END PROCESS
PICK ONE OR MORE FROM 'Relationships - with Params'
Process SelectRelationsWithoutAccount_1

Code: Select all

FIND Relationship WHERE Relationship IN Register.ob_Issuer.RelationsWithPerson
If SEARCH_COUNT =0 Then END PROCESS
SelectRelationsWithoutAccount_2 USING Register, Relationship, QueryParameters
Process SelectRelationsWithoutAccount_2

Code: Select all

INSERT Relationship IN QueryParameters.Relationships
QueryParameters.ItemsCounter=QueryParameters.ItemsCounter+1
Query 'Relationships - with Params' has the following condition:

Code: Select all

FIND Relationship WHERE Relationship IN ThisQueryParameters.Relationships AND ThisQueryParameters.LIRUID=LoggedInRegularUser.ID ORDER BY Relationship.Person.Name
Niels
(V9.0 build 3241 - MariaDB - Windows)
Post Reply