Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.

►Q◄: How do you pass an object as input to a query?

BenHayat

Q1:Just like process, I need to pass an object to a query, so I can do a find based on the object passed in, just like we do in process.

Since I didn't have an answer, I used a process to do the "PICK FROM" or "DISPLAY". But this gave me a list that is meaningless.
Q2: How do you customize List from DISPLAY or PICK FROM

This led to my third try/question. In the Process, I used FIND to find me a bunch of objects.
Q3: Now that I got the result, how do I send the result to a query to show?

Thank you in advance!


tford

One way would be to store the found objects in a reference attribute of LoggedInRegular User. The objects can then be displayed in a query whenever you'd like. Of course the attribute of LoggedInRegular User using for holding the found objects can also be cleared whenever necessary, like at the beginning of each new search.


BenHayat

tford wrote

One way would be to store the found objects in a reference attribute of LoggedInRegular User. The objects can then be displayed in a query whenever you'd like. Of course the attribute of LoggedInRegular User using for holding the found objects can also be cleared whenever necessary, like at the beginning of each new search.

Thank you for the reply;
At first I thought about your strategy, since I had recently READ another post of yours similar to this, but not quite similar to make it work.

My original question, was a bit generic first to see if there is a standard way. Here is more information about the case and why saving to LoggedInRegularUser isn't the ideal way of approaching it.

Firstly, it is an "Object" that needs to be passed, and not simple type VALUE like a Text.
Secondly, this means the Regularuser has to have attributes of every Object type in the Model, i.e. (Customer, Order, Product, Tax, Manufacture and etc.) in order to save it to.
Thirdly, this Object is a "Returned Object" from another Query that User selects. At this point, I don't have a way of storing this selected object into RgularUser and then "USE" it to the next Query, so the next Query would use it as an Input to FILTER against.

It's not like someone is entering a value in a form to be passed to the query. A user first runs another query (say, a list of customers), she gets a list then she picks a customer to call another query. the second query needs to look for any object that belongs to that customer. However, this query is based on a table that has no direct relationship to Customer, it's a grand kids of Customer (bottom of object graph), so it's not like a one -> many relationship.

So, I decided to pass it to a process and do the FIND in process (which works), but I can't get the result in a grid that I can select the attributes to show to user. I used DISPLAY and/or PICK FROM, but I can't seem to customize the output. (that was my next Questions)

HOWEVER, here is the good news.
Last night before sending this post, I did try calling another query from the first query, but It was not Filtering the records based on selected Customer, because it was not passed to to filter against and that what prompted this post.
Then later at (3:00 AM 🙂 ) I re-did it but a bit differently, and suddenly it worked. As it seems, a Query DOES pass an object to another query in a silent way (not like Process that you have to tell it at design time), WHICH MEANS ANY QUERY CAN PASS ANY OBJECT AT RUNTIME, without declaring it as an input at design time. 😃


tford

Glad to hear you got it sorted out, Ben!

Also wanted to clarify a future reference regarding the user of LoggedInRegularUser (LIRU).

Firstly, it is an "Object" that needs to be passed, and not simple type VALUE like a Text.

I frequently create reference attributes in LIRU so entire objects can be stored & referenced and not just attributes.

One other advantage to the LIRU approach is the ability to later display the filter values that led to the query results being displayed. In some cases I have displayed the filter values on a form above the final query & in other cases I have shown the filter values in the title of the query (in more recent builds of AwareIM).


BenHayat

Tom, great points...

Also wanted to clarify a future reference regarding the user of LoggedInRegularUser (LIRU).

Did you mean "use" or "user"?

Also, are you saying, if you have 50 different object types in your system Model, you create 50 Object references in the LIRU to store the values? I just wanted to make sure I understood you clearly!


tford

Did you mean "use" or "user"?

Use --- good catch.

Also, are you saying, if you have 50 different object types in your system Model, you create 50 Object references in the LIRU to store the values? I just wanted to make sure I understood you clearly!

You should be able to if you need to. In my case, I normally have 5-10 key fields I regularly search on in a system & would create reference attributes to search purposes.