Create relationship between 2 fields on the same custom table

Nic Omaha
Tera Guru

Hello I am having a hard time wrapping my brain around this one. We have a custom table with 2 fields we would like to compare. 

Order Number and Original Order Number

 

We would like a related list that shows the following:

If Order Number and Original Order Number Match OR  If Order Number and Order Number match

 

Any help is appreciated! 

Nic

5 REPLIES 5

SanjivMeher
Kilo Patron
Kilo Patron

You can do Order Number 'Same As' Original Order Number in the query.


Please mark this response as correct or helpful if it assisted you with your question.

I got this to kind of work. 

gr.addQuery('sys_id', '!=', parent.sys_id);
current.addQuery('u_order_number', parent.u_order_number);
 
2 Issues.
1. The related list still shows the current record Im in on the list 
2. I cant see to add the OR statement to say Order Number same as Original. 
 
 

You can try something like this for the OR statement

gr.addQuery('priority', 1).addOrCondition('priority', 2);


Please mark this response as correct or helpful if it assisted you with your question.

Ok here is what I am trying. I also would like to point out ( but I dont think it should matter) is that these are both string fields. I know there are orders that should match but nothing comes up. Ideas?