[4.2] - Formula return as a string does not accept a return - Forum - Rollbase - Progress Community

[4.2] - Formula return as a string does not accept a return

 Forum

[4.2] - Formula return as a string does not accept a return

This question is not answered

Hello,

I have a formula field and I am performing the return of the formula as a string. There is a bug with this field in the formula area.

1) var str = "";

return str; // Throws an error

2) var str = "";

str; // Works fine

I think it should work properly using the first approach. Formula field doesn't recognize a return for strings.

Iram

All Replies
  • Hello Iram,


    There is no Function defined which should return the str. The error is appearing due to that.

    Thank you,

    Karthikeyan
  • Sorry I jumped too soon - it worked in other areas where you can use a template. With the blank string, I do not see a problem in the 4.2.1 which was released over the weekend. Can you please try this on the 4.2.1?

    Further, if you place a token which returns String without the quotes , error is thrown.

    The following works but throws an error without the quotes around the token :

    var str="{!fiName#value}";

    return str;

  • Hello ,

    So basically it didn't work in 4.2? We won't be upgrading to 4.2.1 unfortunately so don't think I would get to test whether it would work there or not. However I have tested it in the beta release and seems to work ok there.

    Cheers.

    Iram

  • Iram,

    Could you do a "Debug Formula" and share the results of the Parsed Formula? as the return statement should work just fine.

  • Hi Santosh,

    This is the code for the formula field that gives the error. Please have a look.

    var array = ["Progress", "rollbase", "Cloud", "Applications"];
    
    var uniqueArray = array.filter(function(item, pos) {
      return array.indexOf(item) == pos;
    });
    
    var list = "";
    list = uniqueArray.toString().replace(",", " | ");
    rbv_api.println(list);
    return list; // errors