Can anyone confirm if the Remember Last Selected Value toggle on a Link DocField actually works? I’m unable to get it to work. I’m assuming this feature exists to make form entry faster by autofilling the last selected value.
I can’t make it work either. I opened a bug report in github for it:
opened 01:11AM - 14 Jun 23 UTC
bug
<!--
Welcome to the Frappe Framework issue tracker! Before creating an issue, p… lease heed the following:
1. This tracker should only be used to report bugs and request features / enhancements to Frappe
- For questions and general support, use https://stackoverflow.com/questions/tagged/frappe
- For documentation issues, refer to https://frappeframework.com/docs/user/en or the developer cheetsheet https://github.com/frappe/frappe/wiki/Developer-Cheatsheet
2. Use the search function before creating a new issue. Duplicates will be closed and directed to
the original discussion.
3. When making a bug report, make sure you provide all required information. The easier it is for
maintainers to reproduce, the faster it'll be fixed.
4. If you think you know what the reason for the bug is, share it with us. Maybe put in a PR 😉
-->
## Description of the issue
Setting flag remember_last_selected_value on docfield doesn't bring last selected value on Create New action
## Context information (for bug reports)
Current Javascript create_new.js only checks remember_last_selected_value if the variable user_default is already set. This has a logic error, since the user_default variable must be filled with the last selected value in the case of not being previously filled with user defaults provided by get_user_defaults function.
**Output of `bench version`**
```
frappe 14.27.0
```
## Steps to reproduce the issue
1. Set remember_last_selected_value on any docfield of type "Link"
2. Go to the doctype, add a new record and save it
3. Create another record and the docfield will be empty
### Observed result
Docfields with remember_last_selected_value don't remember last selected value
### Expected result
Field should be filled with last selected value
### Stacktrace / full error message
Not applicable
## Additional information
OS version / distribution, `Frappe` install method, etc.
I’ve made a pull request to fix this bug, I hope they approve it soon.
frappe:develop
← treasuryesc:develop
opened 02:08AM - 14 Jun 23 UTC
<!--
Some key notes before you open a PR:
1. Select which branch should t… his PR be merged in?
2. PR name follows [convention](http://karma-runner.github.io/4.0/dev/git-commit-msg.html)
3. All tests pass locally, UI and Unit tests
4. All business logic and validations must be on the server-side
5. Update necessary Documentation
6. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes
Also, if you're new here
- Documentation Guidelines => https://github.com/frappe/erpnext/wiki/Updating-Documentation
- Contribution Guide => https://github.com/frappe/frappe/blob/develop/.github/CONTRIBUTING.md
- Pull Request Checklist => https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist
-->
> Please provide enough information so that others can review your pull request:
Setting flag remember_last_selected_value on docfield doesn't bring last selected value on Create New action.
Explanation details in frappe#21364
> Explain the **details** for making this change. What existing problem does the pull request solve?
This changes the logic to allow the docfield to be filled if it wasn't previously filled by user defaults. It will be filled with the last selected value for the field.
> Screenshots/GIFs
2 Likes