Copy Paste Quotation Items : Description and Rate not applied

Hello all.

I’m trying to copy and paste records from Excel into the Quotation Items form. All works well and I can paste data with and without a header line. However the Description and Rate values are not applied but read from the database. How can I force the Description and Rate to be applied.

Thanks so much.

Description and Rate fields are dependent on other fields, they will fetch the data from the Item Master once you click on Save.
It will require you to comment out the code for a while for the system to stop fetching the values from the database.

Thanks so much @harshit-30

When I inspect the fields in Customise Form > Quotation Item > Description/Rate, I see that their data types are Text Editor and Currency respectively, not Link.

I’ve set In List View = true for Description, as is the default for Rate. During normal data capturing, not copy paste, both Description and Rate can be provided, although the value is initially fetched from the database. This is correct behavior and the Amount is correctly calculated based on the updated Rate. It is this same behavior that I’d like to have for copy paste. If I provide a header line with Description and Rate, then the intention is to overwrite the values fetched from the database. How can I achieve this behavior without any clumsy work-around?

PS : Since @szufisher is the original author of this copy past functionality, may I take the liberty to ask you what your thoughts are on this matter. In essence, if a header line contains any field which is normally fetched from the database, then rather use the value provided by the copy paste. Is this possible?

Good information thanks for sharing

I’m not a developer, hence I’m keeping this thread alive in the hope of someone giving me some guidance on how to achieve this. I can help myself with basic coding (JS and Python) but would need assistance in getting it done.

I can follow the gist of the JS in as provided by @szufisher but I’m not sure how to amend this, let alone how to override the built-in capability specifically for Quotations but not for other DocTypes.

Any guidance on this would be much appreciated.

because copy & paste also works on updating existing records with partial column data, do as below

  1. copy paste without rate and description
  2. place the cursor on any cell of the first row, copy and paste only rate and description column data.

because program used either field name or label to locate the target field in the child table,

for Quotation Item DocType the section break label and description field name are both description(program converted to lowercase), so for this specific case, your need either to change the section break label to another one or change the

Hopefully this simple workaround is acceptable.

1 Like

Ah… thanks so much @szufisher

I actually started working on a custom data capturing grid for Quotation Items, based on your code, which is displayed when the user clicks a custom button named “Copy and Paste”. In the event of my code actually working, I’ll report back here to share it with others.

Thanks for helping out :+1:

You are more than welcome, I will continue to enhance this feature as needed, because per feedback so far, it is used by a lot of people.
currently there are still 2 open issues

  1. can only copy no more than 50 rows each time after child table support pagination, more than 50 rows will goto a new page,
  2. the line break(ENTER key) in the long text field is auto removed which is not desired.

Is it appropriate for me to ask whether you could please add the above requirement to the list of open issues?

If a user provides a header line with a field name/label, then the intention is to overwrite the values fetched from the database.