Duplicate Quote - Salespeople removal and Task List Set

When we duplicate a quote, the new quote shows the same current task set of the old quote (I want it changed to the default start point task set), and I want all names removed off the list of Salespersons.

Our task set assigns tasks to a group. When the task is assigned to an individual in the group, that individual is added to the list of Salespersons (to ensure they receive notifications on changes to the quote).

I have tried pre and post method directives on Quote.DuplicateQuote method directive, but I am not having success (I do not get the results I am expecting using SetField widget). Is what I am using the best approach to solve this issue?

Strange that when I run tracing on Duplicate Quote, nothing is logged…?

Given that, my next steps would be to make some guesses at which BO is executing (Quote.DuplicateQuote is a good guess but may not be right!), and add some Display Message widgets on them.

It might be that you need to run it on Post Quote.DuplicateQuote, making sure you get the new quote number. Then GetQuoteByID (load its dataset), update that dataset, set RowMod = ‘U’, and then call Quote.Update.

Alternatively you could do it as a data directive, when any new quote is made, set the task and salesrep to your defaults.

I could not make anything work with the method directive of Duplicate Quote. So I used a data directive on QuoteHed.Update, with a condition on the group the user who called the method belongs to. Then I set the TaskSetID field of the added row to the initial stage I wanted.
image

That piece seems to work in testing.

Because in Quote Entry, the People - Salespersons - List are not located in the QuoteHed table (they are in QSalesRP table), how do I set a data directive to change the “primary” and then delete the Salespersons that are Not one of the 4 defaults?

1 Like

You could make a function to do that. You could also do it as a method directive.

Ultimately, you’ll have to trace the deletion of a sales person and then do that very same thing when they don’t meet your condition of being one of the 4 defaults.

I traced it and it looks odd to me. Like it’s calling the update method when I am deleting the salesperson and I don’t see a row mod or anything like that. I’ll have to play around with it.

I agree the trace looks odd (but I am not very good at following traces). I see GetNewOrGetByID, Update, ChangeTaxRegionCode, Update, GetRows, GetByID, and GetDatasetForTree.

What I want to try is if you have the in your BPM for your newly created quote, if you delete the rows from the QSalesRep table within that dataset that don’t match your criteria and then send that dataset to the QuoteHed.Update Method you should get your intended result… at least that’s my hypothesis. I haven’t tested it yet. I am about to head out. If I didn’t have plans tonight I’d get it figured out for us.

Nah, I think it’s easier than that. If you have your QuoteDataSet data set in your BPM you need to loop through the QSalesRep Datatable and mark Rowmod =“D” for each row that you don’t want in there. Then you send that object to Quote.Update.

@BKen I was playing around with it and you could probably use a post processing BPM on the QuoteImpl.DuplicateQuote method.

You can loop through the result set from the QuoteImpl.DuplicateQuote method to find the QSalesRep Table and then from there you can update RowMod = D for each sales rep that you would like to delete from the dataset. Then send that dataset to a QuoteImpl.Update method and those people will be deleted from the quote.

@BKen if you want to work on this after 5PM EST tonight let me know.

Thinking you can do something like this with widgets if you want. You design a query off your QSalesRep Table and then you join the actual sales rep table to that where salesrep.inactive = true.

Then you’ll have all the rows that you want to delete so you set the rowmod = “D” in the configured mappings portion (second photo).

I don’t know what you mean by “Not one of the 4 defaults,” in your post above, but there’s a few different ways we could get those defaults and then make a condition to set the rowmod = “D” for those that don’t match.

Ultimately you send this whole result set back to the Quote.Update method to delete the rows you marked to delete.

I will work on this some more today (if I do not get too bogged down with other things). When we duplicate the quote, I will first need to change the Primary salesperson (the primary salesperson cannot be deleted).
The 4 defaults that I mentioned are “Groups” basically an email address that goes to a distribution list. This allows a group of user to be notified of an available task, then one user from that group adds themselves as a salespersons to let the others in the group know that they are working on this particular task. The default groups are Applications Engineering, Design Engineering, Sales Administration, and Sales. These groups appear on every “machine” quote, then as more groups accomplish their tasks, individual users that completed the tasks are added to the Salespersons list (so they can be notified individually of any changes or updates).

I will need to change the primary. Running a trace on changing the primary salesperson (I did not copy the UserTracingImpl BO info):

<tracePacket>
  <businessObject>Erp.Proxy.BO.QuoteImpl</businessObject>
  <methodName>Update</methodName>
  <appServerUri>https://centralusdtpilot.epicorsaas.com/Redacted/</appServerUri>
  <returnType>System.Void</returnType>
  <localTime>11/1/2022 08:27:07:3607307 AM</localTime>
  <threadID>1</threadID>
  <correlationId>9bb7bfe2-a5b1-4867-a64d-f7ce540005f8</correlationId>
  <executionTime total="193" roundTrip="189" channel="0" bpm="0" bpmDataForm="0" other="4" />
  <retries>0</retries>
  <parameters>
    <parameter name="ds" type="Erp.BO.QuoteDataSet">
      <QuoteDataSet xmlns="http://www.epicor.com/Ice/300/BO/Quote/Quote" />
    </parameter>
  </parameters>
</tracePacket>

<tracePacket>
  <businessObject>Erp.Proxy.BO.QuoteAsmImpl</businessObject>
  <methodName>GetDatasetForTree</methodName>
  <appServerUri>https://centralusdtpilot.epicorsaas.com/Redacted/</appServerUri>
  <returnType>Erp.BO.QuoteAsmDataSet</returnType>
  <localTime>11/1/2022 08:27:07:9414983 AM</localTime>
  <threadID>1</threadID>
  <correlationId>73c5f2a5-3096-41fa-8fda-6ed815619f43</correlationId>
  <executionTime total="117" roundTrip="115" channel="0" bpm="0" bpmDataForm="0" other="2" />
  <retries>0</retries>
  <parameters>
    <parameter name="ipQuoteNum" type="System.Int32"><![CDATA[109418]]></parameter>
    <parameter name="ipQuoteLine" type="System.Int32"><![CDATA[1]]></parameter>
    <parameter name="ipStartAssemblySeq" type="System.Int32"><![CDATA[0]]></parameter>
    <parameter name="ipCurrentAssemblySeq" type="System.Int32"><![CDATA[0]]></parameter>
    <parameter name="ipCompleteTree" type="System.Boolean"><![CDATA[False]]></parameter>
  </parameters>
</tracePacket>


I would have thought that I would see the “change” in the primary flag identified, but maybe I am missing it.

I am with you, I feel like I have talked to someone about this before.

It’s extremely odd we aren’t seeing it.

But if you put a messagebox on the pre-processing directive for Quote.Update and you display the QSalesRep table in the messagebox you’ll see the RowMod is a “U” for the salesrep that you just defined as primary I believe.

Nah, you’re right I don’t see anything!

We do know that the quote.Update method is being called though.

The Primary Salesperson can be selected on a drop-down on the Summary Tab and the Header Tab of Quote Entry. The help info on that field is:
image
It is not a database field.

I wish the trace would show what exactly was changing when the primary is changed.

I am with you on that, but we are in the dark.

All we do know is, it’s calling the update method.

you have to click save, right?

I do have to click save.
So I changed the drop-down on the Summary tab (instead of just clicking the checkbox on the People - Salespersons - List) and the trace showed BO.QuoteImpl, method ChangeTaxRegionCode. Going to dig deeper.

Brian, we aren’t changing taxes so logically this doesn’t make sense.

We should hop on a call. You have teams?