Crystal Reports - Sales Order Picking Sheet - Adding User Name Generates Blank Pick Sheet

SOLVED

Hello, 

I'm trying to modify my picking sheet so it shows which Sage user created the sales order. I'm using Sage 100 ERP 2013 and Crystal Reports 2011.

I have "SO_SalesOrderDefaults" added in Crystal Reports under Database Fields, but when I add "UserKey" to the template and print a picking sheet (just using Preview, not actually printing), the sheet turns up without any of the order information and only shows the template itself. I've tried using SY_User table and the SO_SalesOrderWrk tables as well. I've tried linking the fields - linking the sales order number in the picking sheet table to the userkey and I've tried reversing the link. I saw there are lots of options for configuring the links, but it's all unfamiliar to me.

I'm hoping to be able to show which user created the sales order using their Sage "User Logon" or the "First Name" and "Last Name" fields.

Does anyone have any ideas about doing this? 

Thank you

  • +1
    verified answer

    You have a lot of joins going on there that you shouldn't really need and they may impact performance depending on number of records in each table.  You can instead add sourced UDFs to your Wrk table.  The SO_PickingSheetWrk table supports sourcing data from the following sources.

    So what you can do create a UDF in the Wrk table to hold the UserCreatedKey from SO_SalesOrderHeader, then you would only need to join SY_User on the user key fields from each table and you can then print the first and/or last name on the report.

    You should consider creating sourced UDFs for any values that you are currently getting from the IM_Warehouse and CI_Item tables through the table joins so you can eliminate as many table joins as possible from the report.

  • 0

    Don't link all those tables into the report... as David indicates.

    Create a blank formula for "PrintedByUser" and a value should be added runtime (assuming you have the checkbox enabled.

    For Created By user (if Printed By is not good enough), we've used a script to capture that in a UDF which can be passed into the work table.

  • 0 in reply to Kevin M

    Yep, UDFs with a script to populate them in a table that can be sourced into the Wrk table  is a great way to reduce additional table joins in the report.  A lot of times you can leverage child handle objects (*_Svc classes) to get the value you need without have to get your own object handle but there are exceptions.

  • 0 in reply to David Speck

    oSession.UserCode

    oSession.UserName

  • 0
    SUGGESTED

    I created two UDFs, First Name and Last Name in the Sales Order Header table and then created a script that populates the UDF's when the order is created.  I set it up to carry to history and prints on forms as needed.

    Here is the script

    sFirst = "" : sLast = "" : sKey= "" : sCKey = ""

    retVal = oBusObj.GetValue("UserCreatedKey", sCKey)

    Set oUser = oBusObj.AsObject(oBusObj.GetChildHandle("UserCreatedKey"))

    retVal = oUser.getvalue("UserKey$",sKey)
    retVal = oUser.getvalue("FirstName$",sFirst)
    retVal = oUser.getvalue("LastName$",sLast)

    If sKey = sCKey then
    retVal = oBusObj.SetValue("UDF_FIRST$", sFirst)
    retVal = oBusObj.SetValue("UDF_LAST$", sLast)

    end if

  • 0 in reply to Kevin M

    Kevin, I believe they are after the user who created the sales order, not the current user, which could be different if a different user is responsible for printing the picking sheets.  So response is the best way to make sure you are getting the name of the user who created the record regardless of the current user.

  • 0 in reply to David Speck

    Agreed, but Printed By may be enough for a process of entering then printing immediately... and it is super simple to do (checkbox and report formula).

  • 0 in reply to Kevin M

    Thank you both - the picking sheet was already modified by my reseller in the past. I'm a bit hesitant to unlink the tables - I'll take a closer look to see what's linked exactly and what it could be doing. I'll have to see if I'm able to figure out how to use UDFs to accomplish anything that was done with links - maybe there was a good reason?

    About the user field that I'd like to add to the picking sheet, in my case it's the user who created the order, as they're often the one who needs to answer specific questions about the order the warehouse might have - unfortunately, this comes up much more than I'd like. The user who created the order isn't always the one who printed it, since the warehouse personnel print a lot of documents themselves, as well as customer service representatives.

    I'll keep this suggestion in mind, as there are likely cases where I could benefit from adding the Created By user to the document.

  • 0 in reply to BigLouie

    Thank you, I'll have to look into this more to understand exactly how I'd use it.

  • 0 in reply to neuropathy

    I would make a copy of the form and try to remove all of the tables except for the work table.  Use UDFs, as someone else mentioned, to pass data from various tables to the work table.