I have a requirement of creating new object named Prescription which will have a relation with each Line Item in Order form.
With each line item I need to show the prescription details.
I have tried with business foundation where I can create a new object where I can create relation with contact list but there is no Line Item object with which I can create 1:1 relation of my new Object.
Please help and show the way I can do this.
This relation should also view from commerce manager order details in Line Items.
Your case is quite interesting and challenge. I've not got time to dig into this case but just have an idea.
LineItem.Properties is flexible and we could use LineItem.Properties to solve this case.
LineItem.Properties is a Hashtable, we could store Prescription to LineItem.Properties["Prescription"] - for example. But I'm not sure about those properties could save an object to DB, so IMO before storing Prescription to LineItem.Properties["Prescription"], we could serialize Prescription object - should be as a json string:
LineItem.Properties["Prescription"] = <Prescription json object>;
However, for display Prescription in Commerce Manager, we still need extending something in CM - you could contact Support team for better support for this case.
Regarding storing the data I'd go with Son Do's approach as well.Regarding displaying it in Commerce Manager, the easiest way is to add columns to LineItem-rows in the details tab. This might not give a great overview of the lineitem/prescription if the prescription item has so many properties that it would add too many columns to the line item rows.I can write up an example of how to do this if you want to go with this approach.
© Episerver 2017 |
About Episerver World