In the Space: “SAP and Budgeting” I have two related databases: “Booking” and “Budget Category Line” (many-to-many).
To match bookings automatically to pre-configured budget categories, I need to update the entity collection field “Budget Category Lines” for the Booking where the script is ran on.
Running this without the filter works fine, but when running it as it is, it gives this error:
“Button” failed
executeSingleCommand: ‘Period start’ field was not found in ‘SAP and Budgeting/Budget Category Line’ database.
Originally, “Period start” and “Period until” were lookups from another relation of Budget Category Line, but that shouldn’t be the issue as I also tried it as a “formula lookup” and also direct date field.
The fields exist…
Here’s the relevant part:
const budgetCategoryLines = await fibery.executeSingleCommand({
“command”: “fibery.entity/query”,
“args”: {
“query”: {
“q/from”: “SAP and Budgeting/Budget Category Line”,
“q/select”: [“fibery/id”],
“q/where”: [
“q/and”,
[“<=”, [‘Period start’], “$entityBuchungsdatum”],
[“>=”, [‘Period until’], “$entityBuchungsdatum”]
],
“q/limit”: “q/no-limit”
},
“params”: {
“$entityBuchungsdatum”: entityBuchungsdatum
}
}
});
Thanks!