I am getting few json response from service as "-@@EmptyComplexField@@-". Due to which screen crashes. How to do a proper empty check for complex feild in maximo anywhere. Please help with sample code.
Asked
Active
Viewed 78 times
3 Answers
0
We can do a empty check for list as below if(list && list!="-@@EmptyComplexField@@-")

developer
- 92
- 7
0
Not sure why you're getting this EmptyComplexField string down at your layer. Are you sure you've defined your multiplicity correctly on the OSLC Resources app for these new children objects?
if (/-or-many$/.test(complexAttribute.multiplicity)){
var attributeName = complexAttribute.remoteName;
if (!(attributeName in data)){
Are you making sure these complexattributes are set as requiredattributes on the view before you display it?

scott dickerson
- 908
- 1
- 5
- 13
-
Yes, I am adding OSLC resource in required attributes of the view – developer Apr 08 '16 at 09:14
0
The most correct answer would be:
if (list && list != PlatformConstants.EMPTY_COMPLEX_FIELD) { ... }

mstrahinic
- 117
- 1
- 10