Multiple Function calling in Browse Maintenance

AhsanKhan

New Member
I am calling 2 functions in 2 different local-var fields of browse maintenance. but only first function is returning the value. next local-var field is showing blank data. Can anyone suggest the possible reason.

Thanks.
 
Hello,

Can you send to me the value of properties field (expression) of each your local-var and a copy your code. Each local-var must call a different function .

ex :
local-var01 : expression : fxx-xmp10(ih_domain, ih_ship)
local-var02 : expression : fxx-xmp11(ih_domain, ih_nbr)

And the code must be like :

function fxx-xmp10 returns desc ( input ip_domain as char, ip_ship as char) :
……..
end.

function fxx-xmp11 returns char ( input ip_domain as char, ip_nbr as char ):
……..
end.

Best regards.
 
I'm having the same problem. I'm new to Progress, I'm familiar with SQL Server so this is very different from what I'm used to.
I have 2 functions that I'm calling in 2 local-var fields and only the first column will display data, the second column is always blank.
Here are the functions:
Code:
/*used in local-var01*/
FUNCTION getWORelQty returns decimal (input part as character):
define variable WORelQty as decimal no-undo.
assign WORelQty = 0.
for each wo_mstr
              where wo_mstr.wo_domain = global_domain and
              wo_status = "R" and
              wo_part = part no-lock:
WORelQty = WORelQty + wo_qty_ord.
end.
return WORelQty.
END FUNCTION.


/*used in local-var02 */
FUNCTION getSumStuff decimal (input part as character, input wonumber as character):
define variable WORelQty2 as decimal no-undo.
define variable summedtotal as decimal no-undo.
assign WORelQty2 = 0  summedtotal = 0.
for each wo_mstr no-lock
              where wo_mstr.wo_domain = global_domain and
              wo_status = "R" and
              wo_part = part and wo_nbr = wonumber:
WORelQty2 = WORelQty2 + wo_qty_ord.
end.
summedtotal = WORelQty2 + 5.
return summedtotal.
END FUNCTION.
 
Last edited by a moderator:
Nellida, you've got those functions defined in the Local Variables tab? How are part and wonumber being defined / assigned? I suspect that they don't have values (or the values you expect) and therefore your FOR EACH doesn't return anything.
 
Hi dulecki. In local-var01 I'm referring to function getWORelQty (wo_part) in the expression field. In local-var02, I'm referring to function getSumStuff (wo_part, wo_nbr).
In the Query tab, If I select "No" in the Include section for local-var01 , then I get data in local-var02.
Also, if I switch the order and place local-var02 first then I will get data but not in the local-var01.
So, this leads me to believe that somehow referring to the same table in two functions is my problem.
 
Hello, Your 2 functions are on wo_mstr. Try to use a buffer on wo_mstr for your second function. I had the same issue with a browse on abs_mstr table and to fix this issue i use buffer. Best regards
 
Thank you, Pechadre.

I am using Progress within QAD when creating a Browse. Using a buffer for local-var02 worked as long as I put local-var02 column before the local-var01 which uses the function. If I change the order in the query tab then the local-var02 is blank. The order of columns is important to my end users.
 
Back
Top