The CreatorCon Call for Content is officially open! Get started here.

Sys_relationship table

Udit5
Tera Contributor

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!

2 REPLIES 2

Omkar Kumbhar
Mega Sage

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);
}

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Basheer
Mega Sage

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 hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.