Developer forum

Forum » Development » Get All Quote States

Get All Quote States

Dynamicweb Employee
Jeremy Fesmire
Reply

Hello,

We are working on a customization to export quotes via live integration and are having some trouble with getting the list of  quote OrderStateIds. We are using OrderState.GetAllQuoteStates, but that is requiring the QuoteFlowId. The only way to get it to work now is to look in the database and hardcode it which is problematic if using this across more than one project where FlowId could vary.

How can we make this dynamic to get all QuoteStates without hard coding the OrderFlowId? Is there another method to get quote states that would be better? 

 

Thanks,

Jeremy F.


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi Jeremy,

You can get all the quote flows and loop through them...

var flows = OrderFlow.GetQuoteFlows();
foreach (var flow in flows)
{
    var states = OrderState.GetAllQuoteStates(flow.ID);
    foreach (var state in states)
    {
        // add to options
    }
}

You should probably add the flow name to the option text or use a GroupedDropDownParameterEditor to make it more user friendly.

Hope that helps.

Best regards,
Morten

Votes for this answer: 1

 

You must be logged in to post in the forum