21
Views
1
Comments
Solved
[Record Introspect] GetAttributeValues returns an empty list
Question
record-introspect
Web icon
Forge asset by Pedro Gonçalves
Hi.

Downloaded this solution and opened it on outsystems 9.1.

Added a debug breakpoint on the starting point of the ListAttributeValuesEntity Screen Action and Opened the Default Entry point on my web browser (Chrome, by the way). Then clicked on the  "List attribute & values" button then noticed that the action "GetAttributeValues" from the "RecordIntrospect" Extension is returning an empty list. This happens on both, Using an Entity record and Using a Structure record.

Any idea why this happens? is this a problem related to outsystems 9?

P.S. I opened the extesion on Visual Studio and created a test console project for it. Created a Sample Structure and called the MssGetAttributeValues() method.

An exceptions was thrown and this line of code:
    string inputAttrValue = ObjectMapping.getAttrValue((MemberInfo)iterInputAttrib.Current, ssRecord).ToString();

Something about this line of code in the public static object getAttrValue!!!
 return field.GetValue(originalObject);

Can this be fixed?!! 
Can anyone help?
UserImage.jpg
Ricardo Soeiro
Solution
Ricardo Soeiro wrote:
Hi.

Downloaded this solution and opened it on outsystems 9.1.

Added a debug breakpoint on the starting point of the ListAttributeValuesEntity Screen Action and Opened the Default Entry point on my web browser (Chrome, by the way). Then clicked on the  "List attribute & values" button then noticed that the action "GetAttributeValues" from the "RecordIntrospect" Extension is returning an empty list. This happens on both, Using an Entity record and Using a Structure record.

Any idea why this happens? is this a problem related to outsystems 9?

P.S. I opened the extesion on Visual Studio and created a test console project for it. Created a Sample Structure and called the MssGetAttributeValues() method.

An exceptions was thrown and this line of code:
    string inputAttrValue = ObjectMapping.getAttrValue((MemberInfo)iterInputAttrib.Current, ssRecord).ToString();

Something about this line of code in the public static object getAttrValue!!!
 return field.GetValue(originalObject);

Can this be fixed?!! 
Can anyone help?
 
ok, I was able to fix it.
instead of passing the ssRecord as input parameter of the getAttrValue, I passed the inputRecord instead.
So.. bascily this line of code:
string inputAttrValue = ObjectMapping.getAttrValue((MemberInfo)iterInputAttrib.Current, ssRecord).ToString();
Became:
string inputAttrValue = ObjectMapping.getAttrValue((MemberInfo)iterInputAttrib.Current, inputRecord).ToString();
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.