How to extract the correct email address from CustCnt.RoleCode

I am attempting to use the Kinetic client to create a Break BPM in Report Style Classic which should be able to send a Customer Statement to the correct Customer Contact email address based on RoleCode=CUS010.
Does anyone know how I achieve this?

If I can get this to work I can then also modify the PO and Invoice process to send emails to the relevant Customer Contacts (i.e. RoleCode PUR010 and INV010 respectively)

I have tried a Send E-mail and in the E-mail template I have selected CustCnt.EMailAddress filtering RoleCode with the value CUS010 but no emails are sent.

How does everyone else setup auto-emailing of these reports?

ta.

Had a little look at this. I see that you have the sales rep role code available if you do a linked table on the customer… Is it sales reps you are after or any contact?

The other approach if you wanted contacts would be to add the custcnt table to the rdd then join it to the customer with and output relationship. Make sure you include the relevant columns.

Then in the SSRS add a routing and breaking with the break on the customer. Include a conditon to check if the custcnt.rolecode matches your value and on true then email the report.


I did a quick test for one customer and that seemed to work, it may not scale…The reason I say that is the reports tempdb will get a custcnt table in it every time you run the report and if the statement print is for a lot of customers and it generally is. Then the table will contain all customers contacts in it and could slow the generation of report data down…

Thanks Simon, in fact I do have the RDD relationship between Customer and CustCnt and I added it to the SSRS but it just print previews the report and does not email.
My Condition supposedly checks for the CustCnt.RoleCode CUS010 and also that there is a @ in the EMailAddress field (just as a crude email present check).

I think the issue may be that in the Customer table the “Contacts” Tab lets you add multiple email accounts (CustCnt.EMailAddress) and you can select the Role by a dropdown under RoleCode.
In this report I only want it to select the address that is for RoleCode CUS010 (Customer Statement E-mail) so somehow I need the logic to link the Code and Address together so that I get the correct one into the Email Template.
I’m thinking I must be missing something simple

Mr. Brian: you should be able to un-exclude the role code in the CustCnt table and then in the Email template filter by Role code

I have already tried this Dave but I get an error when I click OK
image

Mr. brian: Sorry - I should pay more attention.

This works:

1 Like

Sorry Dave, I’ve also already tried that one.
I get a print preview of the PDF but no email.

Mr. Brian: maybe Check your system monitor to see if the email is being sent out?
DavedO

Hmm I’ll change my to an email and see if I get one in Papercut…

I changed mine to be use an email rather than a preview and that worked.

Was going to send you the solution, but I then I just hard coded the email address so will have to modify… Off to another meeting first.

Here is an example…
I tested this and it works in the demo database…

I have only attempted to print for 1 customer. So you may want to test that.

CustSt.zip (71.6 KB)

1 Like

Thanks Simon, the RDD look like mine but how do I get the ReportStyle from the xml?

I compared your RDD with mine and the only differences were you had Name and Func un-excluded from CustCnt and I had one extra Field in the CustomerCustCnt Relationship which I removed (ConNum/PrinPCom) which I had got from a youtube video I had watched.
Now it works exactly as I was expecting!
Thanks all!

1 Like

The zip file is a solution so you should be able to install the solution with solution management it will install the rdd and the report style

I know this is solved for you, but here’s a different way. After you’ve added the CUSTCNT table to the RDD, you can filter it there. In the screenshot, I have it pull the email address where the contact name = INVOICES.

3 Likes

Thanks Steve, that is useful information

Welcome aboard @SLC

I like that. In particular you are not pulling back a lot of useless records.

It makes it simple when you’re creating the breaking, because you only need to select the EmailAddress field, which is already filtered down to only the contact addresses you want (in this case, my INVOICE contacts).
image

1 Like

Steve, if I understand correctly what you are saying, are you putting in “Invoices” instead of the actual contacts name?
Might it be better to use Func?

For each of my relevant customers, I have a contact named INVOICES that contains the email address to send the invoice to:
image
Filtering by this name in the RDD returns only the INVOICES contact for each customer. I then select the CUSTCNT.EmailAddress in the email template in the breaking rule.

1 Like