[Bug]: Suggest no series copilot: why does it populates Last Used No and Last used date fields for new entries
Describe the issue
in TIE open No serties and choose copilot. Asked to generate "create number series for non-inventory items"
Accept results (though description is wrong, it says "Catalog item" but i wanted "Non-inventory") Explore - notice that LAst used no and date are populated. Which is wrong.
Expected behavior
Last used no and date should not be populated.
Steps to reproduce
See description
Additional context
See description
I will provide a fix for a bug
- [x] I will provide a fix for a bug
@DmitryKatson would you be able to pick this up?
Hi @Aleyenda this is not the bug fix. I'd say that this is a scenario that is not supported for now. Let me explain.
- If you want to create new Number Series - Copilot looks at the fields on the Numbering FastTab on the related setup page. For example, for Inventory, it looks at the FastTab on the Inventory Setup page and create Number Series for the fields that are empty.
- In Cronus DB the inventory Setup looks like this
Item NosandCatalog Item Nos.are filled in - means that already configured- When you ask to create no. series and copilot "see" that it's already being created it does not generate new no. series, to eliminate possible duplications.
- You probably saw this output screen
- This screen shows that for your request
non-inventory items, copilot found most probable matchingCatalog Itemsbut it's already existing, so it's greyed out and not editable. If you scroll right you will see the warning message
- You thought, however that it was generated by Copilot and clicked the
Keep it. - In this case copilot didn't do anything, just closed. But as you thought, that Catalog Items No. Series was generated, you loked in the 'Last No. Used' and 'Last Date Used' and saw the values.
- However these values are there, bacause this No. Series was already existing and used before.
Long story short, Number Series Copilot can't generate Relationships No. Series - only the no. series that presents in the setup tables.
@JesperSchulz I looked in the No. Series Copilot documentation and found wrong statement there.
It don't look into the related entities.
https://github.com/microsoft/BCApps/blob/d31434908850507aebc8aca40b7e7fc402b917ce/src/Business%20Foundation/App/NoSeriesCopilot/src/Copilot/Tools/NoSeriesCopAddIntent.Codeunit.al#L100
It searchs first in the relevant Setup Tables and then in relevant No. Series fields there.
Maybe adding Relationships support is a nice adea, but this would be a new feature.
Thanks for the detailed analysis and reply, @DmitryKatson 🚀 We will resolve the bug as "By Design" and maybe add a feature to our backlog which adds this support - however, it doesn't seem too pressing to me, so probably we'll just leave things as they are for now.