Views Reply Votes
Andy Grigger
Andy
 0
progress expression to a table outside of the browse
38
1
00
Posted: Jun 04, 2020   
Votes
Michael Webster
Michael
 3
Replied 

Yes you can do this.

 

Add a column with a local-var. The expression for the local var will be a call to a function. This example gets

the bill-to customer name using ih_hist.ih_bill:

 

getName(ih_bill,"bill-to")

 

The function is defined under the Local Variables tab in the same browse maintenance.Like this:

function getName returns character (input i_address as character, input i_field as character):

def var l_answer as char.
assign l_answer = "".

    case i_field:
        when "bill-to" then do:
            find cm_mstr no-lock where cm_domain = global_domain and cm_addr = i_address no-error.
            if available cm_mstr then assign l_answer = cm_sort. 

        end.    
        when "ship-to" then do:
            find first ad_mstr no-lock where ad_domain = global_domain and ad_addr = i_address no-error.
            if available ad_mstr then assign l_answer = ad_name.
           
        end.
    end case.      

return l_answer.

END FUNCTION. /* getName */
 

00
Replied: Sep 04, 2020
Forums
All
Forum Help
Help Using Forums