Skip to main content
Implemented

Set Default Lookup Behavior

  • February 21, 2019
  • 17 replies
  • 2 views

Forum|alt.badge.img

Currently, if you create a relation between two tables and then do a lookup between those tables, the default option is to not use an explicit join.  However, explicit joins are really useful for understanding a lookup at a glace.  

If explicit joins are not the default behavior, it would be really helpful to be able to specify a default behavior for new lookup creation on the project level.  It's only one click to choose an explicit join, but over hundreds of lookups, it becomes a serious time waster. 

17 replies

Forum|alt.badge.img
  • Known Participant
  • February 22, 2019

+1 for reading and understanding other people's code this would be very useful


Forum|alt.badge.img

Agreed.  My team uses explicit joins in lookups and we also teach customers to do the same as a best practice.

The extra clicks when dragging in a lookup are a bit annoying and this would help fix that by having the option already selected for us.


Forum|alt.badge.img
  • Author
  • Known Participant
  • February 25, 2019

Very excited and gratified to get validation from you two on this!  Thank you for your input and support. 

As an additional note: the training at learn.timextender.com uses explicit joins throughout.  It looks like Discovery Hub function and best practice may be out of sync in this feature.  


Forum|alt.badge.img
  • Author
  • Known Participant
  • February 25, 2019

Two other things on this: 

1) A colleague at my current client pointed out that while the mouseover function to see lookup details is great, it only shows a certain number of joins.  For implicit lookups with more joins than the mouseover shows, the only option is to view the relation the lookup is using in the relations folder.  This is awkward, and lookups with this many joins can occur in AX. This is another advantage explicit lookups have over implicit ones. 

2) He also suggested a great addition to this feature.  If you change the default relation between two tables, and there are lookups in the table that also use the same relations as explicit joins, it would be great if Discovery Hub would check to see if you want to change those explicit joins as well. 

This would allow you to get the clarity of explicit joins along with the flexibility of implicit joins all in one package. 


Forum|alt.badge.img
  • Known Participant
  • February 26, 2019

Doug,

WRT your 2nd point, the reverse should be possible as well:

When you create a lookup and rearrange or add some joins, it should be possible to right click on the joins and say: create relationship based on these joins and set it to default.


Forum|alt.badge.img
  • Author
  • Known Participant
  • February 26, 2019

Oh, that would be really nice!  Great idea.  


Forum|alt.badge.img

There is an existing feature suggestion proposing an elegant solution to the "understanding a lookup at a glace" problem: https://support.timextender.com/hc/en-us/community/posts/360034090392-Lookup-using-default-relation

 

 

 


Forum|alt.badge.img
  • Author
  • Known Participant
  • March 6, 2019

Hi Steven,

That solution is very elegant!  Thank you for linking it here.  I'd still like to see some of the functions suggested in this thread, but the solution you linked to would also add a lot of value all by itself.  I can see why it has 14(!) upvotes!

Lookups have improved so much over the last couple of releases, and I'd love to see this added as well. 


Thanks for bringing this up, Doug!

Steven, that feature request is indeed an elegant solution, so it has been marked as "planned". 

I'm wondering how much that affects this feature request, so please share your views.

Would a visible default relation under Joins lessen the need for explicit joins?

Would you still prefer explicit joins as the default selected setting?


Forum|alt.badge.img

From a design perspective there is a huge semantic difference between the following statements, although the resulting code is identical.

a. Use the default relation (which is ....)

b. Use an explicit join

 

I personally would never arrive in a situation where [b] is the default. So I would say the other request fully covers this one.


Thanks for the quick feedback, Steven!

Anyone else wants to pitch in before I go ahead and consider this solved? ;)


Forum|alt.badge.img

I have one comment before you close it out...

Making the default relationship visible in the lookup fields would be very nice... one thing to consider though is how it would behave if I needed to alter the relationship on a lookup after it is created.

For instance:

  • I add a lookup and have it use the default relationship. 
  • The default relationship now displays under the join criteria for the lookup.
  • I then need to add fixed values to the join criteria... would I be able to just extend the existing lookup joins, or would I just need to use explicit joins like I currently do in this scenario?  Maybe there should be a way to convert the default relation into an explicit join so this type of thing is easier.... we have several tables in AX/D365 projects which require things like this.

David, good input!

I think mixed implicit/explicit joins would be confusing. It's a lot simpler if joins are either inherited from the default relation or explicitly defined by the user.

For that reason, I like your idea of converting an implicit join to an explicit join. And to go the other way, I suppose you could say that the logic is already in place, just delete the join(s)...


Forum|alt.badge.img
  • Author
  • Known Participant
  • March 8, 2019

Hi Thomas,

I'm so pleased to see you guys looking into this!  I think it will be a great QOL boost for all developers everywhere. 

One thing that I would mention is that if you do a lookup into a table with no relation specified, it asks you to define a relation, then adds it to the lookup as an explicit join.  It might be better to add it as a default relation, or to present that as an option. 

It's hard to visualize all the follow-on effects that this change might have since it makes implicit joins so much more useful.  It might be a good time to have a second look at the overall lookup creation workflow for things like what I mentioned above in light of that.


Forum|alt.badge.img

Hi Radek, well written. The main problem at hand seems to be understanding implicit lookups.

I believe converting them to explicit only surfaced in this discussion as a means to have the joins visible, whereas I also firmly believe in keeping things simple and showing implicit joins greyed is perfect in that way. 


Forum|alt.badge.img
  • Known Participant
  • March 11, 2019

"So as I understand, we just need the dialog to remember the previous choice: either implicit or explicit joins.

Additionally, we need an easy way to show implicit joins in the tree. These two simple changes would solve most of the problems people face, without introducing too much confusion."

Indeed. Just give us the option where we can tell TX to behave in a certain way i.e. always copy the default join, or use implicit and show the implicit join in a nice way that doesn't confuse the user.

Converting an implicit join to an explicit join would be handy as well.

Explicit joins are needed anyway when one of the source fields needs to have a value set to a fixed value as you can't include these in the relations (yet?). See also https://support.timextender.com/hc/en-us/community/posts/115009599806-Allow-equal-not-equal-to-fixed-value-constraints-in-defining-relations

I would definitely stay away from mixed joins. Do it either explicit or implicit.

 

 


  • Community Manager
  • February 26, 2021

Thanks for the suggestion!

With the improvements to setting joins on lookups released in v19.6, will consider this suggestion as completed!

Release Notes for Discovery Hub 19.6.x – TimeXtender Support