How to mimic AutoFormatExpr in RTC

DKFFoxDKFFox Member Posts: 12
edited 2014-05-13 in NAV Three Tier
I've seen discussions acknowledging that AutoFormatExpr works differently between RTC and classic but nobody seems to have suggested a solution that works for me.
The problem is this:
I have a Nav table linked to a sql view. The sql view does a select * from a sql table. This sql table has several numeric fields which link to other tables, where the field descriptions are stored.
In classic client you can have an autoformatexpr on a table field which looks up the description in another table and returns it so that the form shows the description instead of the number.
In RTC this doesn't work. The workaround is to use a flowfield to return the description and show both the number and the description on your page but this looks a bit ugly especially when RTC is in charge of rendering. Does anyone know a better way?
Apparently it is possible to use dot net to achieve this - does anyone have an example with code?

Comments

  • vanrofivanrofi Member Posts: 272
    Hi there,

    I have the same fashion issue. Having field No and flowfield Description to show the description of the selected No. is fine, but on a page it would be nice to have these fields next to each other.

    Eg. Vendor no. on item card.

    It looks like this :
    Vendor No : 0101010
    Vendor description : Cronus Ltd.

    I prefer :

    Vendor No. : 0101010 Cronus Ltd.


    Did you find a solution?
  • Rob_HansenRob_Hansen Member Posts: 296
    Is there some scenario here that prevents you from creating a function in the table to return the string you want? Then you'd just set the field to that source expression (the function name) and set the Caption property for it.

    i.e.

    GetVendorNoName(): Text(100)
    IF NOT lrecVendor.GET("Vendor No.") THEN EXIT("Vendor No.");
    EXIT("Vendor No." + ' ' + lrecVendor.Name);
    
Sign In or Register to comment.