How to have a Doc-field just for data fetching?

Hello, I am looking to have a field in my docform which will be used for further data processing. For example I want customer dropdown in my one doctype (But I dont’ want to enter or save customer in my database) I just want that customer to show some details of that customer in my other doctype.

I can’t even make this as virtual field, because making it virtual doesnt’ allow you to enter anything on it, so purpose is defeated.

What can be done? How can this be achieved??

Hello any help on this?

Is there a specific reason you don’t want to store the customer in the database?
This looks like a case of the XY Problem to me.

Yes I mean as I said, I don’t want to save it in the database, I just want to have show some fields which is being referenced though a doctype. Why to store those fields, when they are already in other doctype and I just want to show them .

This is not intended functionality, and is also complicating things for no reason. You should just have a link field to get the customer data. If you don’t want to show it, you can set it to hidden when the form is saved.

If you absolutely need to do this, I guess you can have a Link field to Customer, pick your customer from there, fetch the details you want in virtual fields and on saving the form, you can clear the customer link field, but your database is going to have an empty column in that case.

You can Use html view / long text for only showing something. You can check Tax Breakup in sales Invoice for reference.

1 Like

Hello can you elaborate on this one please?