Hi everyone-
I’m trying to figure out the best way to do this.
We have a list of three fields that always go together like UniqueID, Scientific Name and Common Name. These three fields are inputs on the Item doctype. There are many varieties and species of these items, which is why we create new items with these fields all the time.
If I input one of these items, I’d like it to complete the other two fields that go with it.
At first, I thought I would create a new doctype and then just look this up when creating a new item and one of these fields is inputted. Is that the correct way to do this? What if I need to add a new uniqueID, Scientific Name, and Common Name in the future?
Thanks in advance for any direction!
Have you looked at Item Variants?
https://erpnext.org/docs/user/manual/en/stock/item/item-variants
Yes, you can create a doctype and create a link field and pull other fields when one field is entered
A new doctype seems like a sensible option.
I want to ask, thus every CulitvarID
, Genus Species
, and Common Name
will be a unique combination.
If you make a doctype and feed all the data, then there is a way you can do it.
For that you will have to customize CulitvarID
into a Link field with the name of the Doctype you create in Options
of the DocField. Let us suppose PlantX is the doctype name and culitvarid
is the variable.
Then for Genus Species and Common Name you can mention in options those fields in Plantx that correspond these. Suppose genus
and common_name
are fields in Plantx.
You then mention culitvarid.genus
and culitvarid.common_name
in their options respectively and it will automatically mapped as soon as you select a valid ID from PlantX
.
No explicit need of using custom script or changes in Python.
Please correct me if I have not understood your use case.
1 Like
Yes, you got it exactly! Thanks for this explanation of how it would work.
Yes, each combo is unique so this appears that it should work as I need. I’m assuming with a new doctype, I can import the data or do I have to hand enter each one?
Simply create the doctype according to your needs.
Now if you wish to import bulk data, then while you create there will be a checkmark station Allow Import - check that to yes.
Later when you have created it, download excel sheet via Import tool and fill in the required fields and import. In case if any errors you may commit, you can always correct them and re-upload.
Yes, it’s all done. Thanks!
1 Like