Difference Between get_all vs get_list

Dear Team
Kindly help me with one scenario.
in this query, I can get all the fields mentioned

Blockquote

doc=frappe.db.get_all(“Employee Internal Work History”,
filters={
‘parent’: self.employee
},fields=[‘idx’,‘branch’,‘department’,‘designation’], order_by=‘idx desc’)

Blockquote

but in this query I am able to get only two field and others as none

Blockquote

doc=frappe.db.get_list(“Employee Internal Work History”,
filters={
‘parent’: self.employee
},fields=[‘idx’,‘branch’,‘department’,‘designation’], order_by=‘idx desc’)

Blockquote

What are the reasons for designation and branch to be None in get_list query?

@rkroy39 get_list apply user permissions for the records for the session user. if you don’t have permissions for a specific document , it wont appear .
frappe.db.get_all is same as frappe.db.get_list but will fetch all records without applying permissions.

But I logged in as an Administrator. Then I think it should be able to get to.

Second, What is the difference between branch and designation doctype that it is not able in the current user? How do I find it so that I get to know it well in advance about when and how to use it?

@rkroy39 verify your user and permission .
branch is like you have 2 branches of your company , different cities . different buildings . they are called branches . for example HQ branch , and factory branch .
designation is what the job called for a specific employee . for example a software engineer .
the reason branch and designation not appeared because of level permissions . open customize employee , open the branch field and check permission level . reset it to 0 . also give permission of branch and designation to the user .

Perm Level is 0 for all fields
but one change I observed is In Global Search, it is ok in the designation field.
Is that the reason?

do you have permission for doctype branch and designation ?

Yes. i have for whole Employee Doctype

yes i have

It is a bug. You should not be able to retrieve any fields apart from the meta fields such as owner, creation, modified etc.