How to extract the correct email address from CustCnt.RoleCode

In this example it’s for invoices, but you can do the same for statements, acknowledgements, etc.

1 Like

Thanks Steve, this is great, I have tested it with Func(tion) and it works the same. I will leave Name for the Full name of the contact as a lot of people have email addresses that don’t show the correct spelling of their full name which is useful to have.

I like the approach, but what about the primary contact flag, does that not give enough granularity, surely there would be either a group email or individual that deals with Billing, Purchasing and shipping?

I am also wondering if the use of the Function Field might be better, than the name? You are going to end up with a whole heap of person contact records with the name INVOICES.

Whatever field works best for you; in my case the name worked best for me.

2 Likes

As an aside to this, I noticed my test report worked but when I tried to make all changes to my Production report it didn’t send the email.
I did a side-by-side comparison and found that the test RDD had Report Type as “Base Definition” and the Production one had “SQL Server Reporting” - changed this to Base Definition and now it emails successfully.
Not sure I understand the how’s and why’s but no matter.

Actually I notice that the Demo Report Style in the old client Report Style Maintenance has the default CustST as the Data Definition which should have been my CustST_Demo which I cannot now change

1 Like

That is odd, you should be able to change the RDD on the report style at any time.

Are you doing this in the kinetic UI or the classic, if in Kinetic use the classic to confirm.

I am using a combination of both, using the full client with Classic Report Style to do the Break/Change but the RDD only in the web client.

So here is where it gets weird, in the Classic Report Style I can change the Data Definition using the drop-down under the Style Detail tab but when I click the SSRS Break/Routing tab I cannot change it.
The Demo Style shows CustSt under the Break/Routing despite showing a custom DD in the Style Detail, and it cannot be changed in here.
image
image

Wow I have never noticed that and have never had a need to change it… Not sure of the ramifications if different… But looking at the field help the values are stored in two different tables.

EDIT
My mistake yes you can delete the breaking and routing… In classic you need to click on any of the fields in the in the SSRS Routing and Breaking and then click on the X in the toolbar. That will allow you to delete it and readd it with the correct data def.

Have not noticed the SSRS Report history in the overflow menu. That is a nice value add…

Does not look like you can actually add a routing and breaking in Kinetic. :frowning: + sign is disabled.

Cheers Simon, I will probably need to do a tidy-up of this job.
Another thing I don’t understand is why it only works if I choose “Base Definition” and not “SQL Server Reporting” in the RDD

Another good question… I think you will find that the original Rdd was base.

And just to add to the confusion

RDD Report type = Base
Report Style Report Type = SQL Server Reporting…

None of the field help or any documentation I can find provides any in depth detail on what the Base Definition is.

Deleted the Demo Break and recreated, now showing the correct DD, thanks again Simon.
Another good learning exercise.

Effectively I think Base Definition is the original CustSt without any modification (but I could be wrong)

Another interesting discovery is that the Criteria needs to have ToSystemCode = “ERP” otherwise all you get is a print preview and no email.
If you create it and forget to type ERP in there then the only way to fix is to delete the criteria and re-create.

1 Like

That is unusual, I copied my test version with the different rdd on the report style and breaking, deleted and readded the breaking and the rdd matched the one on the style…

Not so unusual seeing as it’s me! :smile: As my dad always used to say “If there’s a difficult way to do something, you’ll find it!”

1 Like