Use the SingletonBO attribute to always show an object in a Detail View instead of a List View. When you create your business object, you should plan to only ever have one instance of it in your database. This attribute is replacing the now obsolete ISingletonBO interface.
[SingletonBO]
public class ApplicationSettings : XPCustomObject
{
private static Guid oid = Guid.Parse("3a58c6ae-811a-4a62-a15a-24856f1bec0b");
public ApplicationSettings(Session session)
: base(session)
{
}
[VisibleInDetailView(false), VisibleInListView(false), VisibleInLookupListView(false)]
[Key]
public Guid Oid { get => oid; set { } }
//We create this section below for convenience and is not required
public static ApplicationSettings GetInstance(IObjectSpace space)
{
return GetInstance((space as XPObjectSpace).Session);
}
public static ApplicationSettings GetInstance(Session session)
{
ApplicationSettings settings = session.GetObjectByKey(oid);
if (settings == null)
settings = new ApplicationSettings(session);
return settings;
}
}