0

Error code doesn't make sense. What am I missing.

I have three Tables the first is a list of Applicaitons with many fields, the second a list of Operating Systems Instances and the third a list of Servers. Iwant to crate a view on the Apps form of the OSIs and another view of the servers.  The first view of the OSIs works fine.  The linkage between Apps to OSIs and then to Servers doesnt and give a surprising error.  Any thoughts appreciated greatly.

 

Relationship Apps to OSIs is 1:n and OSIs to Servers is 1:n.

Error states "Return type mismatch for then and else expressions, at line 7, column 59.

The code is :

let x := lower(substr(this.app_nam, 0, index(this.app_nam, " ")));
let ARY := (select IR_SNow_Apps_to_OSIs)[contains(lower(app_name), x)];
let RESULT := "";
let RES1 := "";
for i in range (0, count(ARY)) do
let y := item(ARY,i).server_fqdn;
RESULT := select IR_SNowServer_OSIs where server_fqdn = y;
for j in range (0, count(RESULT)) do
RES1(j) := item(Result,j);
end;
end
RES1

What I want is to have result RES1 show in the view.

2 replies

null
    • Mconneen
    • 3 yrs ago
    • Reported - view

    What is the error you are getting?    You set RES1 as a string.. then it looks like you try to use it as a function RES1(j)

    • Alain_Fontaine
    • 3 yrs ago
    • Reported - view

    To create a view showing the records on the other side of an established relation, it is not necessary to use the select function. In the view definition, in the formula field, you can simply put the name of the relation. If you want to display the records of a table that sits farther away in the relations graph, you can concatenate the relation names with a dot, hereby "navigating" the relations graph.

Content aside

  • 3 yrs agoLast active
  • 2Replies
  • 461Views