Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Invoke-HaloBatchProcessor #61

Open
4 tasks
machine-bit opened this issue Mar 11, 2025 · 1 comment
Open
4 tasks

[Bug]: Invoke-HaloBatchProcessor #61

machine-bit opened this issue Mar 11, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@machine-bit
Copy link

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?

@machine-bit machine-bit added the bug Something isn't working label Mar 11, 2025
@machine-bit
Copy link
Author

Done a bit more digging its to do with the [Array[]] thats in line 15 of New-HaloRecurringInvoiceBatch. Thouhg maybe its because its also already a Array

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants