Some fields are not listed in the doc object in the server side script

Hi,
Some fields are not listed in the doc object in the server side script
for example:
dif=frappe.db.get_value(“Stock Ledger Entry”,{“name”: doc.name},“stock_value_difference”)
frappe.log_error(“dif”,dif)
dif is None
OR
doc.stock_value is none
or
stock=frappe.get_doc(“Stock Ledger Entry”, doc.name)
stock_value is none