Sys_relationship table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 12:13 AM
Hi all,
I need to create relation between the two table.
All the same caller/customer should be visible under a table.
for this use case ,i wrote - current.addQuery('u_customer_name.name', parent.u_customer.name); - this is working fine
but now I need to give one more condition as if 'customer name' field is empty in parent table then there should not be any record in the related list, I tried to give simple if condition like if (parent.u_customer != '') {current.addQuery('u_customer_name.name', parent.u_customer.name);} if this 'if' condition does not match the condition then the relations shows all the records of different different customer( I don't want to show any record in that case if customer is empty)
Can anyone help please?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 12:51 AM
Hello @Udit5 ,
Can you please try the below code if this works
if (!parent.u_customer ==' ')
{
current.addQuery('u_customer_name.name', parent.u_customer.name);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 12:52 AM
Hi @Udit5 ,
Just to clarify things in relationship
current means the table which is being queried
parent means the table which is being applied to
As per my understanding of your scenario the code should be like this
if(JSUtil.nil(parent.u_customer)){
return false;
}
else
{
current.addQuery("u_customer_name.name",parent.u_customer.name);
}
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.