logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
infotech@reesassociates.com  
#1 Posted : Thursday, March 23, 2023 9:30:37 PM(UTC)
infotech@reesassociates.com

Rank: Newbie

Groups: Registered
Joined: 3/9/2023(UTC)
Posts: 8

Thanks: 5 times
Hello,
I'm really struggling with with this for some reason. I am able to add a customer invoice without issue. I am also able to see (while debugging) that I am able to retrieve a NameModel (customer type) from the database, but whenever I try to save a model for either a new or existing customer it always fails. The API doesn't seem to return any sort of error or exception for this function like it does when saving a CustomerInvoice. I've tried using preserter.ValidateModel and I do not get any validation errors.

Am I missing something?
tony  
#2 Posted : Tuesday, March 28, 2023 4:08:04 PM(UTC)
tony

Rank: Advanced Member

Groups: Registered
Joined: 2/28/2018(UTC)
Posts: 48
United States
Location: Pennsylvani mostly

Was thanked: 7 time(s) in 7 post(s)
Sorry for the delay.

The SaveModel on customers shouldn't normally throw errors like Customer Invoices.

When the SaveModel fails, does it fail by returning false? If so, the model.Errors collection should have something in it. Or does SaveModel return true yet you don't see the new name in CenterPoint?

I can't think of anything that would explain it off the top of my head. Can you add a customer to sample data with NamePresenter? I only ask this because I can test the same scenario with your code without having to have you send in your database.
infotech@reesassociates.com  
#3 Posted : Tuesday, April 18, 2023 6:52:00 PM(UTC)
infotech@reesassociates.com

Rank: Newbie

Groups: Registered
Joined: 3/9/2023(UTC)
Posts: 8

Thanks: 5 times
Thank you! I was able to figure out what was going on with customer/name presenter. Now I'm getting an error about not being able to insert a null value into OpenOperioID.
tony  
#4 Posted : Tuesday, April 18, 2023 8:15:25 PM(UTC)
tony

Rank: Advanced Member

Groups: Registered
Joined: 2/28/2018(UTC)
Posts: 48
United States
Location: Pennsylvani mostly

Was thanked: 7 time(s) in 7 post(s)
Yeah, that's an annoying error that you get when you try to create a transaction for a period that doesn't exist yet in the CenterPoint database.

The way to get around it is to go into CenterPoint, open your database, and go to Processes and open up any transaction form (e.g. Customer Invoices). All you have to do to open periods is enter a date in the UI. So if you enter 4/18/2023 in the Date field on a customer invoice, all the periods up to and including April, 2023 get opened up. You don't have to save an invoice either - entering a date and moving off the field triggers the period-creating logic (so you can enter the date, move off the field, and then click Close .)

Usually we don't run into this except in testing because in production the CenterPoint database is being used and kept current. In your place, I'd actually enter a date to open up the whole year like 12/1/2023.

Edited by user Tuesday, April 18, 2023 8:24:12 PM(UTC)  | Reason: Not specified

thanks 1 user thanked tony for this useful post.
infotech@reesassociates.com on 4/18/2023(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.