Skip to Content

Get email of Sales Employee into CrystalReport

Hello,

is somehow(sql select) possible get email of user to CrystalReport. I have user connected to Sales Employee and my goal is get the email from card ORDR - Sales Order.

what I did try:

SELECT
T0.DocNum, T0.CardCode, T0.CardName, T1.ItemCode, T1.Quantity, T1.Price, T2.[SlpCode], T2.[SlpName], T3.[E_Mail] FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode INNER JOIN OUSR T3 ON T2.SlpName = T3.E_Mail

but this doesn't work as I need

Thank You

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jul 20, 2016 at 02:26 PM

    Hi,

    Do you want to add email id for sales emp or user who creating document?

    Please try this query to get user's email ID,

    SELECT

    T0.DocNum, T0.CardCode, T0.CardName,

    T1.ItemCode, T1.Quantity, T1.Price,

    T2.[SlpCode], T2.[SlpName],

    T3.[E_Mail]

    FROM ORDR T0

    INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry

    INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode

    INNER JOIN OUSR T3 ON T3.UserId = T0.UserSign

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

    • I try this,

      SELECT

      T0.DocNum, T0.CardCode, T0.CardName,

      T1.ItemCode, T1.Quantity, T1.Price,

      T2.[SlpCode], T2.[SlpName] ,

      T3.[salesPrson], T3.[email]

      FROM ORDR T0

      INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry

      INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode

      INNER JOIN OHEM T3 ON T0.SlpCode = T3.salesPrson

      before I had problem, that when I drag/drop the field into the form, it made empty all values in form


      but after restart CrystalReport it is ok ann works fine

      Thanks everybody for all hints

  • author's profile photo Former Member
    Former Member
    Posted on Jul 20, 2016 at 02:25 PM

    Hello,

    You may try with below query:

    SELECT

    T0.DocNum, T0.CardCode, T0.CardName,

    T1.ItemCode, T1.Quantity, T1.Price,

    T2.[SlpCode], T2.[SlpName],

    T3.[E_Mail]

    FROM ORDR T0

    INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry

    INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode

    INNER JOIN OUSR T3 ON T2.SlpName = T3.U_Name

    Here you have to be sure the value in the field SlpName and U_Name is similar i..e Case sensitive to be checked up. For example, If the value in SlpName is JOHN then in U_Name it must be JOHN and not John or john.

    Hope it will help you.

    Regards,

    Kuldeep

    Add a comment
    10|10000 characters needed characters exceeded

    • I have tried it, but when I use in form 'E_Mail' ..it clear all other existing values in report ... makes them empty


      I have report about Sales Order 'ORDR', on this card is Sales Employee

      Sales Employee I have connected to user and rightly there is the E_Mail

      my idea is put on the report name of Sales Employee and append to him email from user 'OUSR'

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.