Hi, sorry I don't have a development license for NAV now, the following is an idea of BC. I'm not sure if they are exactly the same, but hopefully it will give you a reference.
You need to do two things.
1. When Type is empty, also run the Lookup page.

In the standard code, it only runs when the Type is Item.

2. When validating Cross-Reference No., fill in Type first. (Otherwise, if Type is empty, filling in Item No. will prompt an error.)

Hope this helps.
Thanks.
ZHU