-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Describe the bug
In client testing, when UPSERTing a Sales Order, if the Customer Name includes filter special characters, if Related Field Id logic is enabled, you get a filter error message.
To Reproduce
Steps to reproduce the behavior:
- Create a Customer with Filter Characters in the Name
- Call the SPB-SALESORDER endpoint (generated) using that customer
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots / Sample JSON / Endpoint XML
Error given looks like:
"[{\"Row\":-1,\"Column\":1,\"Error\":true,\"Detail\":\"Writing data failed: The filter \\\"Touble*Mak'r \\\"Client\\\" (Of D|O|O|M)\\\" is not valid for the Name field on the Customer table. An error occured while interpreting the filter: Did not expect '('.\\r\\n\\r\\nFor more information, see https://go.microsoft.com/fwlink/?linkid=2158058.\"}]"
Additional context
The SetFilter call on SPBDBraiderDataEngine line 207 should be a SetRange:
https://github.com/Spare-Brained-Community/SBI-DataBraider/blob/main/SBIDataBraider_APP/src/EngineOperations/SPBDBraiderDataEngine.Codeunit.al#L207
Additionally, when I put in the fix for this, the other thing I would likely do as well: Here, the only lever to shut off this functionality is global - SPBDBraiderSetup "Disable Related Id". This means the only workaround for this bug is to globally disable an important function.
I would add two new settings:
- On the Configuration Endpoint page, I would add a Disable Related Id flag in the Advanced Settings, then use that field here in the control statement. However, I notice that I did add that setting, but did not implement the control logic for it. So, bug [BUG] RelatedFieldId Issues #2, this of the more mundane "What a clever option, shame you didn't implement the functionality for it" sort.
- On the per-field basis, in the Advanced Settings, I would also have a Disable Related ID flag for per-field control of this logic. This, I may add to the SPB- standard endpoints for the various "Name" fields on the Sales and Purchase Header, as we're doing a related ID for the Bill-to Customer Name, but that isn't needed, as we have that relationship ID already from the Bill-To Customer No.