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.
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?
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.
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):
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.
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:
It is not a database field.
I wish the trace would show what exactly was changing when the primary is changed.
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.