I’m trying to automatically populate the Cost Center field in the Sales Invoice Item doc by fetching the value of a custom link field (also titled Cost Center) in the Sales Order doc. Add Fetch doesn’t seem to work in this case. Any suggestions will be greatly appreciated
Hi @wale . The same script works for me , open the console and check for the errors, could you please ensure are you using the correct field_name in the above script .
Since this involved cost centre which has impact on your P&Lreports and other thing, its best to do server side customizations…
I have had issues when I wrote js code which involved fetching data from server and because of connectivity issues it didnt execute.
This is definately case for server side customization(unless you again you write js code to validate if your add_fetch or other methods have executed properly) .
Yes, the field_name is correct. Are you using this script in a child table? The problem seems to be that the scripts don’t work in child tables. Pls confirm
Could you have a look at this method? Also, keep in mind you may need to refresh the form after, or save/validate and the info should populate. (Ignore the pet about it not working for long text)