scheduledTransaction.update
Change a scheduled transaction's fields, Schedule, end or template transactions.
Changes the fields you give; the rest stay. end sets one kind of end and clears the other. templateTransactions
replaces the whole list: an entry or split that carries the guid of an existing one keeps its identity, one without a
GUID is new, and any left out is deleted. Turning autoCreate on turns notify on unless you say otherwise.
The last occurrence, the instance count and the deferred instances are not changed here; only Since Last Run moves them, as in GnuCash. Disabling a scheduled transaction leaves it out of Since Last Run; nothing disables one on its own, even when it has ended.
Examples
Example: with a copy of the synthetic/rich example book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"scheduledTransaction.update","params":{"scheduledTransaction":"52f96837087e9670c933f9421b0ac626","enabled":false}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"guid": "52f96837087e9670c933f9421b0ac626",
"enabled": false,
"warnings": [],
"…": "…"
}
}
Request:
{"jsonrpc":"2.0","id":2,"method":"scheduledTransaction.sinceLastRun","params":{}}
Response:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"summary": {
"toCreate": 0,
"…": "…"
},
"schedules": [],
"…": "…"
}
}
Command line
red-ale exec --book book.gnucash --script - <<'EOF'
scheduledTransaction.update {"scheduledTransaction":"52f96837087e9670c933f9421b0ac626","enabled":false}
scheduledTransaction.sinceLastRun {}
EOF
It prints:
[
{
"guid": "52f96837087e9670c933f9421b0ac626",
"enabled": false,
"warnings": [],
"…": "…"
},
{
"summary": {
"toCreate": 0,
"…": "…"
},
"schedules": [],
"…": "…"
}
]
MCP tool call
Tool call:
{"name":"scheduledTransaction.update","arguments":{"scheduledTransaction":"52f96837087e9670c933f9421b0ac626","enabled":false}}
Result:
{
"structuredContent": {
"guid": "52f96837087e9670c933f9421b0ac626",
"enabled": false,
"warnings": [],
"…": "…"
}
}
Tool call:
{"name":"scheduledTransaction.sinceLastRun","arguments":{}}
Result:
{
"structuredContent": {
"summary": {
"toCreate": 0,
"…": "…"
},
"schedules": [],
"…": "…"
}
}
Effect: write, on the Book.
Params
Params of scheduledTransaction.update; absent fields are left alone.
scheduledTransaction(Guid, required): The scheduled transaction.name(string or null): The new name.schedule(array of RecurrenceParam or null): A new Schedule.templateTransactions(array of TemplateTransactionParam or null): New template transactions, replacing every one; those carrying a GUID keep it.enabled(boolean or null): Since Last Run leaves out a disabled one; default true.startDate(Date or null): The first possible occurrence; default today.end(End or null): The end; default never. Setting one kind of end clears the other.autoCreate(boolean or null): Create due instances without asking; default false. Refused with variables other thani, with more than one commodity, or with no template split.notify(boolean or null): And say so; default true withautoCreate, refused without it.advanceCreateDays(integer (int32) or null): Days ahead to create; default 0.advanceRemindDays(integer (int32) or null): Days ahead to remind, after that; default 0.
Result
A scheduled transaction, with every field GnuCash's file holds.
guid(Guid, required): Identity.name(string, required): The name; names need not be unique.enabled(boolean, required): Disabled ones are left out of Since Last Run and the forecasts.startDate(Date, required): The first possible occurrence.end(End, required): The end, as stored.lastOccurrence(Date or null): The last occurrence acted on (created, ignored or postponed), or null if never run.instanceCount(integer (int32), required): The Instance count: the value ofifor the next instance.autoCreate(boolean, required): Create due instances without asking.notify(boolean, required): And say so.advanceCreateDays(integer (int32), required): Days ahead to create.advanceRemindDays(integer (int32), required): Days ahead to remind, after that.schedule(array of Recurrence, required): The Schedule, as stored.nextOccurrence(Date or null): The next occurrence after the last (or the first), or null when it has ended or never occurs.deferredInstances(array of DeferredInstance, required): The state saved before each postponed instance, in file order.templateAccount(Guid or null): The template account's GUID, or null when there is none.templateTransactions(array of TemplateTransaction or null): The template transactions, in the template account's split order; absent inscheduledTransaction.list.variables(array of string, required): Every variable the formulas name,iand the exchange-rate variables, sorted bytewise.warnings(array of WarningInfo or null): What GnuCash's editor would have asked to confirm; only from methods that write.