Here I am using frappe-ui
Jokes aside, we are building some little apps for different purposes (field force, HR checkin ā¦). Best way to learn is diving the code of Frappe apps ā¦ LMS, HelpDesk, Gameplan, Drive ā¦
Here I am using frappe-ui
Jokes aside, we are building some little apps for different purposes (field force, HR checkin ā¦). Best way to learn is diving the code of Frappe apps ā¦ LMS, HelpDesk, Gameplan, Drive ā¦
Youāre lucky! I usually blow every mine in the frappe-ui minefield.
FrappeUI is growing and pretty undocumented yet ā¦ but is fantastic and easy to learn.
This recent video from @buildwithhussain is really good too.
There are different levels of abstraction and also a data hierarchy.
If you ask for a list, you get just the ānamesā of the documents: the unique doc references for the ārowsā in a doctype table. So you can get a big list with little data. Then you can drill down to get documents.
With lots of data you also will need to include paging when advancing through lots of data.
You can pick fields, which can bring you between mere ānamesā (really IDs) and full documents including subtables. These documents can get big.
So with the need to navigate the tradeoffs between āmany but smallā and ājust one but very bigā, there are different possibilities to build stuff.
Also, if you get a doc, set some fields to new values and and then just āinsertā or āputā or however the API calls its methods, then it also gets interesting because you can manage big docs (DT instances with many fields) with just some lines of code, and the complexity of big, complicated custom DTs is just kind of hidden behind some beautifully crafted lines of the nice framework.
So, all this software crafting has many interesting facets.
I may be wrong, but for the moment, I disagree. The three of them provide basically the same service when tailored with fields
(when possible).
If they are used without fields, I donāt want a function (createListResource) to get only a cryptic list of names (0489l150rq, ā¦ because doctype donāt have to be tailored (Title field) based on the limitations of the API right?), then click randomly on one record to get (createDocumentResource) ALL the fields and beyond, even data that is not related to the doctype:
All this for EACH record (you canāt āpick fieldsā in createDocumentResource).
(count them in my post above [MYSTERY SOLVED] REST API: How to simply GET a record usinf frappe-ui? - #17 by frappefr)
Thatās more than 100 key-value pairs not related to the doctype itself (3-6 useful fields in a todo).
Even if it was only for trusted clients, itās already slow, I donāt want customers to GET all this (including name of staff who modified the record), then filter out everything on the client.
Hope this make more sense.
Iād still say it depends on the use case.
You could have sales orders with hundreds of line items, even with photos.
Lag could be an issue.
You could build an archive app with extreme requirements.
A book app with thousands of scanned pages.
Or some other kind of data silo with many many detailed but small info bits (web logs, car flows, weather logs every minute over 30 years, you name it).
Requirements and limitations of can vary wildly.
Whatever, no need to argue, I wish you fun and success building apps with your framework and UI of choice.
Strange, it works fine for me. If youāre in a development environment, errors would go straight to the console via stdout. Are you not seeing them there?
That said, I agree fully with @avc that createListResource
and createDocumentResource
are usually better interfaces for frappe data. In FrappeUI, createResource
is the generic http interface, and it works for both frappe and non-frappe data. Itās also used for calling system-level methods that arenāt tied to a specific doctype.
Others have explained why a List/Doc distinction exists, but one thing Iād add:
Just be careful here, because using createListResource
to filter fields isnāt a protection. If you have data that you donāt want guests or customers to see, thereās no javascript solution to that problem. Your permissions configuration on the backend is the only thing that matters here.
Soon this will be usable ā¦
Maybe I donāt get what you meant, I didnāt mean to argue, I apologize.
Thatās what I get (server and browser console):
Maybe we donāt have the same versions?
erpnext 15.x.x-develop
frappe 15.x.x-develop
"frappe-ui": "^0.1.98"
The only error.log I have is worker.error.log:
I totally agree.
This raises another question: How to prevent certain (meta) fields to be read by certain users?
I donāt see this āpermission by fieldā in the doctype. āPermissionsā tab is for all records, fields donāt have this granularity.
Could you please show me an example @peterg?
Donāt worry; I said this to myself as well.
Our perspectives are somewhat different, I was looking from a point closer to the technical side, the transmissions and such, and you know more about the frappe UI, which I found (and find) interesting and inspiring: Iāll look into this more, but canāt do that ATM, but will probably need it at a later time.
Itās hard to say. Youāre on a pre-alpha development branch, so anything could be the cause. If you want to troubleshoot, your best bet is probably to set some breakpoints with a debugger to see whatās going on.
https://docs.frappe.io/erpnext/user/manual/en/changing-the-properties-of-a-field-based-on-role
I didnāt choose it on purpose , just bench init
If stuff is not working on latest version, and we donāt know which frappe version was used to make apps and plugins, I wonder how to know what is supposed to work on what we have.
Thank you for the link, my bad!