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?
Send FIND output to formatted query
-
- Posts: 1457
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Send FIND output to formatted query
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:
Process SelectRelationsWithoutAccount_1
Process SelectRelationsWithoutAccount_2
Query 'Relationships - with Params' has the following condition:
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)
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'
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
Code: Select all
INSERT Relationship IN QueryParameters.Relationships
QueryParameters.ItemsCounter=QueryParameters.ItemsCounter+1
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)
(V9.0 build 3241 - MariaDB - Windows)