Try ERPNext Buy Support Partners Foundation Foundation Members

Custom Validation of two filed

Hi,
I want to vallidate form on the basis of two fileds,
I i have fileds “is temporary” checkbox link with “from_date”,& “end_date”

I want to check if is temporary checbox is check then and then the “from_date” & “End_date” filed are appear otherwise no.
Is there any possibilities to do this?

You should add Eval Conditions for this inside your fields from_date and to_date.

in the warehouse doctype i added three filed one is is temporary checkbox second if text box with label From_date and third is To_date …here i want to create script for when i select the is temporary check box then the below two fileds are appear otherwise no .like that i want to do so is there any chances to perform this …if any please let me know thanks

You no need to write any script for this . Just customize warehouse doctype and add one condition in “depends on” property of your from_date and to_date fields .
Condition is eval:doc.temporary.

Is this correct?? but having yellow color warning there is any problem to this warning??

@satish_malkar,
Correct Syntax eval:{doc.bill_book_entry == "Supplier"}

1 Like

my filed name is is_temporary
and the doctype is warehouse and module is stock so how to write the eval conditon for the same

Hello @satish_malkar
Have you tried this solution?
eval:doc.is_temporary
Just add the above snippet in the Display Depends On Field of from_date and to_date fields.

Thanks & Regards,
Kalpit Shah

1 Like

yes but there is no effect from that code nothing is happen

It should’ve worked!

Try your luck by going through this to understand the purpose of Display Depends On!

1 Like

in this syntax which is your doctype and which is your filed could you please tell me.
Here i am little bit confused so please help me

Thanks

eval:{doc.is_temporary == 1}

1 Like

ERROR

Missing semicolen
unrecoverable syntax error .(33% sccanned)

@satish_malkar Just update the Doctype/customize Form.
it is showing warning message only, u can add semicolon to avoid above warning message.

1 Like

how to update it please help me

i add semicolon at last like this
eval:{doc.is_temporary == 1};

also but same warning there

If you are working in customise Form than there will be a update button on top-right of the page.
For DocType it will be Save button on top-right page

1 Like

only menu and save button are there

Click on the save Button. :slight_smile:

1 Like

already i save that doctype