Need help customizing doc view

Hi ,

Could anyone just tell me how to control the view of a particular field with multiple queries , the below code works like a charm but I need to add one more query , only if it satisfies both the condition , It should get displayed.

eval: doc.type == "Raw Material"

eval: (doc.field1 == "value1" && doc.field2=="value2")

1 Like

@nabinhait Thanks for the reply , I already tried this , but my condition will be , the same field’s value to be fetched for my next query , that is my problem.

eval: (doc.field1 == "value1" && doc.field1=="value2")

Could you please help me .

Did not understand your requirement properly. Can you please elaborate with proper usecase?

1 Like

Hi @nabinhait . Thanks for the reply . I have a select field with options β€œ1”,β€œ2”,β€œ3”,β€œ4” and so on

If I select β€œ3” the first three fields should appear and if I select β€œ4” the first four fields should appear so i wrote this code , but it takes the last condition and neglects the first query ,

eval: (doc.field3 == "3" && doc.field3=="4")

That eval statement is only being met if field3 equals 3 AND field3 equals 4.

If you want β€œor” behavior, replace && with || .

1 Like

@alec_ruizramon1 Thanks a lot , let me give a try .

I think it should β€œor” condition.

eval: (doc.field3 == "3" || doc.field3=="4")


You should use β€œor” condition instead of β€œand” in depends on.

Thank you


Thanks for the info @Divyesh_Amreliya

1 Like

how about for following

eval:(!doc.amended_from || !doc.sales_order)

Not sure what I did wrong, I want this field Display only if either this two field is no info