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

Notification

Icon
Error

Options
Go to last post Go to first unread
logicne  
#1 Posted : Wednesday, June 26, 2024 3:24:05 PM(UTC)
logicne

Rank: Newbie

Groups: Registered
Joined: 3/12/2024(UTC)
Posts: 5
United States

Hello.

I have an integration I built for a customer a few years back that used the older CenterPoint SDK that relied on .NET Framework. This was before the .NET Core SDK was available. That integration has stopped working after the client updated to the newer version of CenterPoint that now only supports the .NET Core integration. I was planning to simply update my project to leverage the new SDK but had some troubles with that, and in researching it I found that it seems like the SDK is not really recommended to be used anymore, and instead the REST API is preferred. I got the feeling that the SDK would eventually be phased out entirely.

So, rather than rebuild the project to use the newer SDK I decided to just use the REST API. I like that better anyway! The problem is, the data I need is the SalesItems. Most of the fields I need are returned by the API but the description is not, and I also have a custom User Defined Field on SalesItems and it is not returned either. My project won't be able to work without those pieces of information obviously. They were returned by the SDK along with a TON of other data fields that I can't seem to get through the API either.

Do I need to adjust my request somehow to tell it to include more fields? If those fields are simply not available, then the REST API seems like a significant downgrade from the SDK... It seems like it would have very limited usefulness with only a handful of fields returned.

Is there something I am missing or doing wrong here?

Thank you!
tony  
#2 Posted : Thursday, June 27, 2024 4:03:22 PM(UTC)
tony

Rank: Advanced Member

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

Was thanked: 9 time(s) in 9 post(s)
We purposely kept the initial REST API endpoints as simple as possible for the first go around, but we were planning on fleshing them out. That said, not having the additional description seems like a miss on my part.

We wrapped up development for our next release a couple weeks ago so squeezing something in might be a hard sell... but what do you know? I just got an email saying that I can add the Additional Description and all the Custom fields to the Sales Item endpoints. I just want to make sure that when you wrote "description" that you mean the AdditionalDescription on the SalesItemModel.
logicne  
#3 Posted : Thursday, June 27, 2024 4:24:05 PM(UTC)
logicne

Rank: Newbie

Groups: Registered
Joined: 3/12/2024(UTC)
Posts: 5
United States

Hi Tony,

Thanks for the reply!

Yes, just to clarify, the fields I need for my integration and was able to get from the SDK are:
- SalesItemId
- Name
- Abbr
- AddDesc
- Sp1
- CustomField1

But as far as I know, I can already get all of these except AddDesc and CustomField1 from the API. But maybe double check if all of those are there to be sure.

That would be awesome if you could squeeze those fields into the next release! Do you have any idea when that release might actually go live?

Thank you!
tony  
#4 Posted : Thursday, June 27, 2024 4:37:00 PM(UTC)
tony

Rank: Advanced Member

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

Was thanked: 9 time(s) in 9 post(s)
Yeah, it looks like we have all the fields you need other than the custom fields and additional description - as long as SP1 is SuggestedPrice.

logicne  
#5 Posted : Thursday, June 27, 2024 4:40:35 PM(UTC)
logicne

Rank: Newbie

Groups: Registered
Joined: 3/12/2024(UTC)
Posts: 5
United States

Actually no, looking back at my data model I was using with the SDK, SuggestedPrice is different.

The SDK returned three fields for me for Sp1, Sp2, and Sp3. I think this are SalesPrices. I only actually use Sp1 though. Would it be possible to add the Sales Prices as well?

Thanks!
tony  
#6 Posted : Thursday, June 27, 2024 5:34:14 PM(UTC)
tony

Rank: Advanced Member

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

Was thanked: 9 time(s) in 9 post(s)
What model and property are your pulling SP1 from?

Pricing is complicated since we have about nine different pricing methods.
logicne  
#7 Posted : Thursday, June 27, 2024 5:42:41 PM(UTC)
logicne

Rank: Newbie

Groups: Registered
Joined: 3/12/2024(UTC)
Posts: 5
United States

So, using the old .NET Framework SDK, I pulled the SalesItems report via the SDK. Then I generated myself a model from the DataTable returned by basically just iterating over every property in that DataTable and generating lines I could use to make a C# model class. The resulting model had properties called Sp1, Sp2, and Sp3. Those names are what the fields were referred to as in the DataTable returned by the SDK. I am not 100% sure how the SDK came up with them.

Poking around in the SQL database directly though, I can see that my client has three rows in the SalesPrices table. Table excerpt below. Perhaps those Sp1, Sp2, and Sp3 fields from the SDK were automatically generated using the Abbreviation column from there, and the values retrieved by joining with the SalesPriceMatrixDetails and SalesItemSalesPriceMatrixes tables? That would be my guess.

Abbreviation Name Sequence
'SP 1' 'Sales Price 1' '0'
'SP 2' 'Sales Price 2' '1'
'SP 3' 'Sales Price 3' '2'

Hopefully that helps clear things up. Sorry, I am not 100% sure how the SDK was coming up with those fields.

Thanks!

Edited by user Thursday, June 27, 2024 5:45:50 PM(UTC)  | Reason: Not specified

tony  
#8 Posted : Thursday, June 27, 2024 6:31:58 PM(UTC)
tony

Rank: Advanced Member

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

Was thanked: 9 time(s) in 9 post(s)
Ha! I've got good news and bad news. Bad news first: I misunderstood which SDK you were using. The good news is that you can do the same thing you are doing now by running a console application, and this won't break when the framework changes.

It sounds like the API you are using is DataAccessAPI which is the DataBrowser SDK. Instead of calling the API directly, you can run the console app instead.

https://www.redwingsoftw...erpoint-data-browser.htm (see "Using the Console Application")

I can help with this process if you want.

logicne  
#9 Posted : Thursday, June 27, 2024 8:35:41 PM(UTC)
logicne

Rank: Newbie

Groups: Registered
Joined: 3/12/2024(UTC)
Posts: 5
United States

Thanks for letting me know about that! That actually worked perfectly and I was able to make use of almost all of my existing code and only needed about an hour to make adjustments to use that Console App method.

I feel silly for missing that before. I had seen it in the documentation before, but glancing at it, I saw the first few instructions were using the Data Browser app, and exporting XML and assumed it was just explaining how to manually get the data from the regular Data Browser. Looking closer I realize it was actually exporting XML configuration, not data, to allow for programmatic execution.

Thanks for the heads up and the help!
tony  
#10 Posted : Friday, June 28, 2024 5:47:59 PM(UTC)
tony

Rank: Advanced Member

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

Was thanked: 9 time(s) in 9 post(s)
That's great to hear!
Users browsing this topic
Guest (3)
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.