Developer forum

Forum » Development » Access to ObjectElement and ObjectType in UserTransaction

Access to ObjectElement and ObjectType in UserTransaction

Filip Hein
Reply

Hi DW

We are working on a solution (DW 9.13.8) that makes use of Ecommerce Loyalty. We have a table in frontend showing users their latest transactions using the UserTransaction class. In case there is an order associated with the UserTransaction we want to be able to link to the order details.

- To do this we would like to have access (Get/Set) to the ObjectElement (So we can get the order ID). We would also like Set access to ObjectType (Get is already available).

- We have also noticed some odd behaviour when accessing ObjectType through the API. If the ObjectType is 'OrderDiscount' in the database, when we request it through the API it is returned as 'User' instead. Can this behaviour be changed so we get the ObjectType that is actually stored in the db?

Can you help us with the above?

Best regards

Filip

 


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Filip

I have made them public and fixed the bug related to ObjectType.

The now public setter makes it possible for you to add stuff to transactions that DW does not understand.

BR Nicolai

Votes for this answer: 1
 
Filip Hein
Reply

Excellent, we'll keep that in mind, thank you for your help!

Best regards

Filip

 
Niels Foldager
Reply

Hi Nicolai,

I don't see any changes yet in the latest version of Dynamicweb. In which version will your changes be available?

Best regards
Niels Foldager

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Niels

Just checked - and it not released. I guess the changeset has been lost at some point. Just made it again, devops#12270

It is in pull request and awaiting approval and merge and will then go into Ecommerce package shortly.

BR Nicolai

 
Niels Foldager
Reply

Thank you, Nicolai.

Best regards
Niels Foldager

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply
This post has been marked as an answer

Hi Filip and Niels

Feature #12270 has been released in Dynamicweb version 9.15.3
Get this from the download section here https://doc.dynamicweb.dk/downloads/dynamicweb-9

Kind Regards
Dynamicweb Care Support
Kristian Kirkholt

 

Votes for this answer: 1
 
Niels Foldager
Reply

Hi Nicolai,

There still seems to be some odd behaviour when accessing ObjectType through the API. ObjectType is "User", even if ObjectType is "OrderDiscount" in the database.



Take a look at this code in Dynamicweb.Ecommerce/Loyalty/LoyaltyRepository.cs:


Best regards
Niels Foldager

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

I see the issue.

We will investigate if this on purpose or coded during beer drinking and hence needs fixing....

BR Nicolai

 

You must be logged in to post in the forum