Developer forum

Forum » Development » Product custom AddIn - save product

Product custom AddIn - save product

Rui Silva
Reply

Hi all,

I'm creating a custom product add-in (for the product detail/edition) that will need to save/check if the current product is saved in the database.

I need to take some database actions based on the product that is being edited and must be sure that product is saved before starting those actions.

How can the add-in check if the product is saved or can I invoke some method to ensure that the product get saved before starting actions on database?

Thanks,

Rui Silva


Replies

 
Nicolai Pedersen
Reply

I do not understand in which context you are in. What is the extensibility point?

Anyways - if you have a productid, you can use product.getproductbyid to see if you have anything in the DB.

BR Nicolai

 
Rui Silva
Reply

Hi Nicolai,

I've a class that creates a custom button for the solution:

    [AddInTarget(RibbonBarAddInTarget.eCom.ProductEdit)]
    public class ProductEdit : RibbonBarAddIn

And the base.Ribbon.DataContext.DataSource does not reflect the changes being made in the frontend nether any kind of flag that I can use to notify the user that must save the product before using this new feature.

Best,

Rui Silva

 

 

 
Nicolai Pedersen
Reply

No that data item does not reflect all the changes. So you have to look in the DB...

 

You must be logged in to post in the forum