Skip to content

[Bug]: Invoke-HaloBatchProcessor #61

@machine-bit

Description

@machine-bit

Contact Details

jamie@fitm.co.uk

What happened?

The ConvertTo-Json -AsArray -Depth 5 both throw an error. Incressed this to 10 its fine. That said I have tried to run through the code and cannot receate line by line. Its not posting all the batches and I end up getting error like

Failed to Save Payments - The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
"Failed to save Invoice Lines - The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.

Failed to Save Payments - The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions."
"Failed to save Invoice Lines - An error occurred while saving the entity changes. See the inner exception for details. - Inner Exception: Violation of PRIMARY KEY constraint 'aaaaaInvoiceDetail_PK1'. Cannot insert duplicate key in object 'dbo.INVOICEDETAIL'. The duplicate key value is (28758).
The statement has been terminated.

Failed to Save Payments - An error occurred while saving the entity changes. See the inner exception for details. - Inner Exception: Violation of PRIMARY KEY constraint 'aaaaaInvoiceDetail_PK1'. Cannot insert duplicate key in object 'dbo.INVOICEDETAIL'. The duplicate key value is (28758).
The statement has been terminated."

It seems to work fine just passing one part of the array to New-HaloRecurringInvoice eg;
New-HaloRecurringInvoice $allPayloads | Where-Object { $_.schedule_id -eq 1821 }

Version

2.184.7

Which operating systems have you tested on?

  • Windows 10
  • Windows 11
  • Mac OS
  • Linux

What PowerShell version are you running?

7

Halo Product

Halo PSA

Halo Version

2.184.7

What command did you run?

What was the output of the command?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions