Help on fetching scrip

i create a field on Sales invoice called fraccao (this fiels is a link of a custom doctype i created called Fraccao), i select when i create an Invoice. i want o pull it or fetch when generate Payment entry to reflet on my field fraccao on Payment Entry Reference

its is not doing it.

@Dany_Carvalheiro share your logic (code) and screenshots, will be better to you get help

i dont have a code,

i just need to the field be autocomplete on payment entry by the field in Sales invoice the same way its fetch the outstading value ou the invoice number!

@Dany_Carvalheiro you will find more information here

i have tryied what is on link maybe i am doing something wrong
i create a script to Payment Entry Reference rigth
here is the code
cur_frm.add_fetch(“fraccao”, “fraccao”, “fraccao”);

but nothing is happening

@Dany_Carvalheiro the issue is that you are replacing the field that fetch the value, the parameters of add_fetch are:

  • link field in current doctype
  • lookup field in linked doctype
  • target field in current doctype

where target field will receive the value of lookup field, so basically you are passing the target as same as link field, and is because that you never will get nothing

i am trying to get you but i am not good on this.

this is my doctype

this is the field on payment entry reference


its come like this on normal mode

from Sales invoice its like this

this is the script


what i am doing wrong?