Problems displaying shortcuts - what could be wrong?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Problems displaying shortcuts - what could be wrong?

Post by lueu »

I have an issue with a shortcut attribute. It doesnt't display in my query, but if I swith on inline editing and make the coulmn editable, I get the values. So they are there, but Aware might not know what row each of them belong to?

BO1: attributes IndName and IndId. BO2: attributes Line, IndId and shortcut IndName. So the IndID should be the same in both, and I want to show the name by querying BO2. Read all the documetation and watched the videos, still need help.. :roll:
joben
Posts: 230
Joined: Wed Nov 06, 2019 9:49 pm
Location: Sweden
Contact:

Re: Problems displaying shortcuts - what could be wrong?

Post by joben »

Having an attribute with the same name and value in two BOs does not mean that they are connected.
How is the relation between BO1 and BO2 made in the first place, and why is the IndID attribute needed? If you can describe the workflow, it should be easy to come up with a permanent solution.

AwareIM is clever in the sense that as long as the relation is defined in the config tool, the connection between the parent and child is made automatically when you are inside the BO1 object form and add/pick a BO2 object.

You can try to force a relation and see how it looks like in the query after that.
Put this update rule in BO1 like this and save the object:

If EXISTS BO2 WHERE (BO2.IndID=BO1.IndId) Then
INSERT BO2 IN BO1.BO2

This should work as long as the relation name is also called BO2.
This rule is obviously not that great, but maybe can serve as an example of the difference how it looks like when the relation is established and when it is not. Your shortcut should display fine after this for the object that you saved.
Regards, Joakim

Image
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: Problems displaying shortcuts - what could be wrong?

Post by lueu »

joben wrote: Fri Feb 09, 2024 1:29 pm Having an attribute with the same name and value in two BOs does not mean that they are connected.
How is the relation between BO1 and BO2 made in the first place, and why is the IndID attribute needed? If you can describe the workflow, it should be easy to come up with a permanent solution.
These two BOs represent 2 tables on my server, where one of them contains the lineNumbers and the belonging indicatiorID, and the other contains the indicatorID and the indicatorName. With a sql statement I would use a join to get a table with the LineNumbers, indicatorID ang IndicatorName. I figured then that I could show the indicatorName belonging to the indicatorID as a shortcut, if I made a reference to the BO first. I followed the relationship video and the shortcut video, and tried to make the reference and shortcut as shown. So the IndicatorID is needed to get the correct indicatorName. Does that make sense?
joben wrote: Fri Feb 09, 2024 1:29 pm AwareIM is clever in the sense that as long as the relation is defined in the config tool, the connection between the parent and child is made automatically when you are inside the BO1 object form and add/pick a BO2 object.
I haven't made a parent/child relation, but peer. Is that wrong? The shortcut video showed peer relationship?
joben wrote: Fri Feb 09, 2024 1:29 pm You can try to force a relation and see how it looks like in the query after that.
Put this update rule in BO1 like this and save the object:

If EXISTS BO2 WHERE (BO2.IndID=BO1.IndId) Then
INSERT BO2 IN BO1.BO2

This should work as long as the relation name is also called BO2.
This rule is obviously not that great, but maybe can serve as an example of the difference how it looks like when the relation is established and when it is not. Your shortcut should display fine after this for the object that you saved.

I will try this. Thaks for the reply.
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: Problems displaying shortcuts - what could be wrong?

Post by lueu »

Follow up question:
Does shortcuts only work for objects created/edited after relationship and shortcuts are made? Not for existing objects in the table(BO)?

Since I can create a new object using a reference attribute to select/set a value, and this will show, but the already existing objects shows nothing in the shortcut column?

Because if this is the case, it's working now, just not the way I wanted it to :)
joben
Posts: 230
Joined: Wed Nov 06, 2019 9:49 pm
Location: Sweden
Contact:

Re: Problems displaying shortcuts - what could be wrong?

Post by joben »

I think it is important to highlight the difference between working in SQL and AwareIM, because maybe it causes some confusion when trying to figure out how shortcuts behave. In SQL you have to keep track on the relations yourself by using unique identifier columns so you can do JOINs etc to connect the correct rows to eachother.

AwareIM on the other hand keeps track on this automatically after you have created a relation between two BOs. AwareIM adds all the relationship logic in the SQL, and is not dependent on self-made ID attributes visible in the Config Tool. After that, you can use a grid, combo-box, etc to establish the relationship during the creation/editing of an object. Then you can add shortcuts to display the attributes of the other BO row.

The only reason I can think of why you would want the IndID attribute is if you are importing data from another source, and want to establish AwareIM relationships based on these values. However, if the users are adding the data themselves, you will not need this attribute. I think IndID is something you might have created because you are thinking in the terms of a SQL database guru rather than an AwareIM Config Tool user :)
lueu wrote: Fri Feb 09, 2024 2:36 pm Follow up question:
Does shortcuts only work for objects created/edited after relationship and shortcuts are made? Not for existing objects in the table(BO)?

Since I can create a new object using a reference attribute to select/set a value, and this will show, but the already existing objects shows nothing in the shortcut column?

Because if this is the case, it's working now, just not the way I wanted it to :)
Not sure if I understand, but as long as you can edit an object and add a reference to a row in BO2 (or use a rule), the shortcut should work fine.
Regards, Joakim

Image
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: Problems displaying shortcuts - what could be wrong?

Post by lueu »

joben wrote: Fri Feb 09, 2024 3:16 pm The only reason I can think of why you would want the IndID attribute is if you are importing data from another source, and want to establish AwareIM relationships based on these values. However, if the users are adding the data themselves, you will not need this attribute. I think IndID is something you might have created because you are thinking in the terms of a SQL database guru rather than an AwareIM Config Tool user :)

You are right thinking the IDs are created by a SQL database guru (not me!). What I forgot to mention is that these tables were not made for this AwareIm project, I just use them because I need the data already in them. The users are not adding data to these tables. Either way, I think references and shortcuts won't work for this, so I will go back to what I originally had. It works, was just trying to make it easier for the users to choose the correct LineID by showing all three attributes together.

Thanks for explaining it all for me :)
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: Problems displaying shortcuts - what could be wrong?

Post by BLOMASKY »

Jumping in the middle here, but to use a shortcut you 1st have to create a relationship between 2 BO's. (Tables). This does NOT automatically populate the relationship in EXISTING records. Only when new records are created. Aware creates 3 fields in the child table (if it is a many to many then a new relationship table is created). So if you have existing records, you can easily write a sql procedure to update the existing records. Newly created records after you define the relationship will be maintained by Aware. If you need assistance in writing the SQL to update the existing tables, let me know.
Bruce
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: Problems displaying shortcuts - what could be wrong?

Post by lueu »

BLOMASKY wrote: Fri Feb 09, 2024 6:01 pm Jumping in the middle here, but to use a shortcut you 1st have to create a relationship between 2 BO's. (Tables). This does NOT automatically populate the relationship in EXISTING records. Only when new records are created. Aware creates 3 fields in the child table (if it is a many to many then a new relationship table is created). So if you have existing records, you can easily write a sql procedure to update the existing records. Newly created records after you define the relationship will be maintained by Aware. If you need assistance in writing the SQL to update the existing tables, let me know.
Bruce
Thanks Bruce, now it all makes sence! :)
Post Reply