Advanced Printing Insert Fields Select All vs First


Does anyone familiar with the APR module know what determines if the “Select” dropdown shows up when inserting fields in a Send Email Node? This is within a Breaking/Routing Rule. I have seen it show up before, and found the below image containing it in another thread on this website, but I can’t get it to show up on mine at all. I have tried creating new Send Email nodes, and even creating a fully new breaking/routing rule, but it still doesn’t show up. I highlighted in red in the image to make it easier to see.

Some background as to why I’m looking for this:

I am struggling with an automatic email based on the QuoteForm where we are trying to include some information about the primary salesperson on the quote. It mostly works, but it seems like the inserted field (meant to be the name of the salesperson) only grabs the first QSalesRP record based on some kind of hidden ordering. If there is only one salesperson on the quote, or if the one it grabs happens to be the primary one, it works fine. If it grabs another one it either shows the wrong information if I don’t add a filter or shows no information if I do. I think if I grab all and then add a filter it should work, but I can’t figure out how to do that.

Any help you can give would be greatly appreciated.

Your problem might not be due to that “Select: All” setting, but rather how the sales people are stored in a quote. I’m pretty sure that it is a single field with tilde separated values for salespeople.

Make a BAQ of the quote head table to view the salesman field. It’ll show the codes for the people. See if the order of the codes shown correlates with what you are seeing in APR.

As far as I can tell the sales people aren’t stored on the QuoteHed table at all. The only field I can find on the QuoteHed table that contains either ‘Sales’ or ‘Rep’ is ‘ECCSalesRepID’, which I think is for a module we don’t use as they are all blank.

The salespeople look to be stored on a separate table, QSalesRP, which contains both the QuoteNum and the SalesRepCode. That is the table I am trying to query to get this Salesperson Name. I will include an image of my “Select Table Field(s)” below.

Also, I think I’ve discovered how it chooses which SalesRep to grab - it looks to be alphabetical based on the Salesperson’s Name.

Here I am getting the SalesRepName from the QSalesRP table.

Sorry for the misdirection on the storage of the salespeople …

But now that you’ve found them, what logic do you want to use choose just one name? The one with the largest commission split? The one added first? Some clue in the name of ID?

It sounds like the default is to order by name, then return the first in the list.


Wait… is using the filter on PrimeRep working now?

No problem! I think Sales Orders store salespeople like that, as a single string with tildes.

I want to choose only the rep marked as the PrimeRep. The filter doesn’t work. It seems like it doesn’t search through the list for one that matches the filter, but instead just takes the first in the list and applies the filter.

So as I have it now, it shows the information if the first in the list happens to have PrimeRep as true. If the first in the list has PrimeRep set to false, it just shows an empty string.


To be clear, when I say the filter does not work, I mean it does not work for my purposes. It does what I think it’s intended to, which is hide the information if it doesn’t match the filter. I think if I can get the “Select: All” setting working, the filter might then start working for me (hiding the other, non-PrimeRep records).

So you are seeing?

Filt Value   Rep Order  Rep is Prime  Result
==========   =========  ============  ========
True         First      True          Rep name
True         First      False         blank
True         Second     True          blank
False        XXXX       XXXXX         blank

And without the Filter enabled, it always returns the First Rep?

Sounds like it only ever chooses the first rep, THEN applies the filter.

Yes, that’s exactly right. I’m pretty sure that is what is happening, which is why I think the “Select All” option would help. It seems like “Select First” is what it’s set to right now.

That “table” named “QSalesRP” was bugging me…

Turns out, that’s not a real DB table, but rather one of the temp tables created by the report process. If you go into the RDD for your report, I bet you see a datasource named “QSalesRP”. And the RDD is actually building that when the report is run.

I’d do the following:

  1. Run the report without that filter (with archive set to one day)
  2. Get the GUID for the report from the system monitor
  3. Go on the SQL server and find the “table” QSalesRP_ and view its contents.

Does that table have all the reps listed or just one? If it is just one, then you’re stuck as the RDD will probably never give you the one you want.

If there is more than one, are they always sorted alphabetically? Maybe you can tweak the RDD to have that data source sort by PrimeRep. Don’t know if this is possible, but seems like what you’d need.

I took a look at the QSalesRP table through SQL and it does indeed include all the sales reps that the quote displays.

I have found a kind of ugly solution - I couldn’t figure out a way to sort in the RDD, but I was able to add a field to the join between QuoteHed and QSalesRP that matches the Quoted field to the PrimeRep field. Since this form can only be printed when the Quote is marked as Quoted, it will always only return the PrimeRep.

If there’s a better way I’d still like to use it as this is kind of a kludge, but it’s the best option I’ve been able to come up with. Thank you for your help!

1 Like

Also, I think I found the answer to my original question. It’s not helpful to me, but I wanted to add it here for anyone who googles this question in the future and finds this post.

It looks like that “select all” box is only available when inserting data into the “To” field.