Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paw Gilkrog 4 posts 86 karma points
    Oct 14, 2022 @ 11:56
    Paw Gilkrog
    1

    Add new property on orderline in the code.

    Hi,

    Is there a way to add a new property to an already existing orderline? Or edit a property in the code when an orderline already exists?

    I have a complete order which I would like to add a property value to each orderline in the code.

    Any help is appreciated.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Oct 14, 2022 @ 12:18
    Matt Brailsford
    101

    Sure, something like this should do it.

    _vendrApi.UoW.Execute(uow => {
    
        var order = _vendrApi.GetOrder(orderId)
            .AsWritable(uow);
    
        order.WithOrderLine(orderLineId)
            .SetProperty("someKey", "someValue");
    
        _vendrApi.SaveOrder(order);
    
        uow.Complete();
    
    });
    
  • Paw Gilkrog 4 posts 86 karma points
    Oct 14, 2022 @ 13:27
    Paw Gilkrog
    1

    Thank you Matt, this did the trick.

Please Sign in or register to post replies

Write your reply to:

Draft