Hi, 

I'm having some troubles with my DB, yesterday Outsystems stopped my account to some updates and since that, my service studio is having some problems like this:

This is some of my databases that don't return me anything, but I have information:

And the information its not showing in my app, just the id 1 its showing me something, but 0 id no.


Anyone knows how can I solve this??

Hi Bruno,

Check filter in this aggregates may here have some condition 

like aggregates.id<> nullidentifire


Regards

Rahul

Hi! 

This is the filter that I'm using: 

Brand.Id = BrandId

It's a simple filter, and what I'm confused its that when the id is greater than 1 the DB returns me all the information normally.


Bst Regards

On many entry forms an ID of nullidentifier() (ie 0) is used to signify a new record creation as opposed to an edit, check the logic in all your events/actions to see if it is trying to do something different on a new record as opposed to an edit.

Hi, Jeanene Williams !

Sorry, I don't understand, can you explain one more time?


Bst Regards

Jeanene is saying that maybe the logic of your application is currently set to create a new record instead of retrieving the specific data for a record. 

You would normally see this pattern for a Product > ProductDetails type of scenario (show filled fields to edit an existing product, show empty fields to add a new product), but perhaps there is an error in a condition/logic flow in your application, so when navigating to the ProductDetails, it is treated incorrectly as a "New Product" every time (hence showing empty fields) instead of showing the details of an entry that already exists in the database.

So from the other answers, I think the problem is that when you use "0" as an Entity Identifier, OutSystems is interpreting it as a NullIdentifier instead of the value "0", so it treats it as a new entry instead of an existing entry. So, if your business case requires an Id that actually equals "0", it might be necessary to add additional logic checks in your application to fix it. Otherwise, it probably isn't of much concern unless you see the same problem with different "expected" values for the Id.

Solution

Hi Bruno,

Can you please answer a few questions first? These will be useful to troubleshoot your issue and eventually report it to OutSystems if needed:

  • What version of Service Studio and Platform Server (Service Center) are you using?
  • Is the Brand entity stored in an External Database that you are integrating with (as opposed to being defined in an OutSystems module)? or
  • If the Brand entity was defined directly in an OutSystems module, does the Id attribute of the Brand entity have its IsAutoNumber property set to False

Complementing what Francisco was explaining above:

OutSystems does not have the NULL concept that is so common in Relational Databases and several programming languages. I will not argue the benefits of such approach here (there are always pros and cons), but a consequence is that in order to represent the lack of a value, OutSystems resorts to specifying a default valued for all data types. In the case of Identifiers/Primary Keys and Reference Attributes/Foreign Keys this is represented by the system function NullIdentifier() that returns... 0 (zero).

Since 0 is recognized as lack of a value for Identifiers, the OutSystems Platform will stop you from using it as a valid Identifier value, which means that you should never have a record with 0 as its Id value for an OutSystems managed entity.

The Aggregate screenshot you show seems odd, given how both records displayed have the same info except for the Id, can you confirm that this data is correct and you actually had two records with the same info in them? It feels like a bug in the Preview of Aggregates (especially since you mention it started happening after some update to your environment?) more than anything else wrong...

Cheers

Solution

Hi, Jorge Martins!

Thanks for your reply!

  • What version of Service Studio and Platform Server (Service Center) are you using?
    • My Service Studio is 11.8.4 Build 26134 and;
    • Service Center Version 11.9.0 (Build 16900).
  • Is the Brand entity stored in an External Database that you are integrating with (as opposed to being defined in an OutSystems module)? or
  • If the Brand entity was defined directly in an OutSystems module, does the Id attribute of the Brand entity have its IsAutoNumber property set to False? 
    • Brand is stored in an External Database with 
      • Public : Yes
      • Expose Read Only: No
    • The AutoNumber is set to No
  • Since 0 is recognized as lack of a value for Identifiers, the OutSystems Platform will stop you from using it as a valid Identifier value, which means that you should never have a record with 0 as its Id value for an OutSystems managed entity. 
    • So just the 0 Id in my Database won't be shown in my forms?
  • The Aggregate screenshot you show seems odd, given how both records displayed have the same info except for the Id, can you confirm that this data is correct and you actually had two records with the same info in them? It feels like a bug in the Preview of Aggregates (especially since you mention it started happening after some update to your environment?) more than anything else wrong... 
    • The data is correct, I just copied because the 1 id was working well.


Bst Regards

Bruno Guidetti


Hi, again!


I searched in all of my actions and I found one that was using 

NullIdentifier()

So I changed this and now it's working. I just can't explain why was working with this param before the update in my Service Center, but I just changed this and is working well.

Thanks!!