Connect multiple UDFs so selecting one will display extra info to be used in Crystal Reports

SUGGESTED

I added a tab to my Invoice Data Entry panel with UDFs

I want to be able to select an option in "SCAC Code" which will then display the proper name of the carrier outside of the SCAC Code dropdown. I want the SCAC Code and CARRIER NAME to be separate items so I can work with both fields more easily in Crystal Reports, placing them where I want in the form that will be generated.

Does anyone know if/how this can be done?

The red arrow shows the SCAC Code drop down, which has multiple options. The blue arrow is where I'd want to have the CARRIER information displayed, based on the SCAC selection.

In this example, I'd like to have the panel display "American Freightways" where the blue text is, when "ARFW" is selected from the SCAC Code drop down. Would "CARRIER NAME" need to be another UDF, or is there another way this should be done. If it's a UDF, it should be easier for me to figure out how to create a new form in Crystal Reports that's designed how I want using these fields. 

The information is going to be needed in Crystal Reports more critically than in Sage, although it will help having the common name displayed in Sage. In Crystal Reports, is it best to use some kind of formula to accomplish this?

Can someone show me an example of formula for Crystal Reports that would display "American Freightways" when "ARFW" has been selected? I'm guessing I'd create a string in Crystal Reports and create some kind of formula that would do this. I'd also like to see an example that shows more than one item, so I know what to do when creating a list of items for all the different SCAC codes and carrier names.

  • 0
    SUGGESTED

    UDT validation for your Code field will create a business object link, allowing you to flow the description to the invoice table automatically (and eventually on to the work table for adding to the form using CR).

    If you only needed to display the description on the panel, and not include it in the work table, just adding UDT validation makes that possible without the extra UDF.

  • 0 in reply to Kevin M

    Thanks for writing up this guide - I'm just getting around to attempting this now. For whatever reason, I'm unable to select the UDFs I'd created for SCAC in Data Source or Column; only the standard fields are available. I'm trying to merely have the description display in the panel, rather than feed into Crystal Reports or anywhere else.

    For some reason, when I edit the fields in the SO invoice header, this message appears: 

    I haven't seen that message anywhere else and it doesn't appear in other tables I've entered to edit fields, at least as I tested a bit today.

    What I'm wondering is if I need to delete the UDFs and recreate them (instead of trying to edit them) to be able to have one UDF link to another, so that selecting one of the options in a drop-down menu (SCAC) will show the linked UDF (SCAC description). It doesn't appear that I can merely edit the SCAC UDF to work how I want it to work even after creating the SCAC DESCRIPTION UDF.  

    I appreciate the work - I'll try to figure this out in the meantime, but I seem to be stuck here. The SCAC UDF was setup as Manual Entry rather than Business Object. Perhaps I'd have to start over with everything here. 

  • 0 in reply to neuropathy

    Where do you expect the SCAC code translations to come from?

    Unless you are planning on hardcoding everything in a script or the crystal report which i would advise against, your best bet is to create a User Defined Table as Kevin suggested and set up the UDT's key field to be the correct length to accommodate the SCAC code, the length of this key column is very important because when you use the UDT for validation for a UDF in another table, both the UDF's length and the UDT's key must be the same length.  

    You then need to create an additional UDF in the UDT to hold the SCAC description, make sure you set its length appropriately.

    UDT Validation will add a lookup to the field instead of a drop box and is the simplest way to get what you want unless you want to script the populating of the drop box by reading the keys from the UDT and then use another script to populate the placeholder UDF for the description which would be read from the UDT based on the currently selected value.

    Since your UDFs in SO_InvoiceHeader have already been created, you will either have to delete the ones you need to remake and update the table, then create the UDF again or leave the existing fields alone and create brand new ones.

    When creating the UDFs, make sure to select the correct validation options.

    Also, if you decide to delete the existing UDFs, i highly recommend you first make a backup copy of ALL of your Custom folders under each module folder, i've noticed sometimes that when a UDF is deleted, it deletes the UDF captions from unrelated fields in unrelated panels. After you have made your backups, make sure to remove the UDFs to be deleted from any panels before you start deleting them.

  • 0 in reply to David Speck

    Thanks for all the input, but I'm really struggling to apply this information. Do you mind going back a few more steps to how exactly I'd need to create these UDFs? Somehow, I'm unable to replicate what I'm seeing above here. My goal is to create a tab in an existing panel (sales order invoice entry) that will have a drop down menu for a particular field that I need - I need this drop down to only have the 4-character code in it, since I need this field to appear this way on the form (Crystal reports) that's generated by this tab. However, in Sage, in the custom tab, I'd like to have the full description of the 4-character displayed when a code is selected. 

    For example, you select code "4DCD"

    And you'd see "4 Digit Code Description" next to the selected drop down item

    This would help me as I'm working with all of this, as well as others I work with, so we don't have to memorize all the codes. 

    Also, I'd be able to use this "description" UDF/UDT in crystal reports, hopefully. 

    I hope this makes sense.

    I've tried creating UDFs in the usual way I know how, but this doesn't seem to work properly. I'm not sure exactly how to create the special user-defined tables. It seems I'll have to delete the UDFs I created and start over using UDTs instead, but I'm not sure how to do this. When I try, I get held up, being unable to select the exact worksheet (not sure if worksheet is the right term here, maybe it's TABLE) that would allow me to add these UDTs to the custom tab. When I've tried, they won't appear, so they're not available to me. My last message (above) should help explain this a little better - I'm just trying to rephrase it a bit to make it more clear, but the images above should show how I was trying to add new fields/tables and wasn't able to find the area to add them where I need to add them, making it so my new field/table wasn't available where I needed it.

    There's something I'm missing in how I know how to do this, which isn't very well. I'm just a user, not any kind of developer and I don't have any training in this. I've only managed to teach myself a few things to make things work a little better for my work. 

    How do I backup all the custom folders, by the way? I'd like to do this anyway, since I need to upgrade versions soon among other things I'd want to have a backup of the customizations for.

    Thank you all - happy new year