I have a form with two selector fields. I want to store the two values in a custom table. The selector fields work and I can select values and save the record. But when I click + to create a new record, the first field still contains the previously saved value. I THINK that the cache is not being cleared when I click +.
This is the form after selecting values:
Click Save and the record saves.
After clicking +
If I lookup a value (any value) for the service type field and click save, I get
If I click Refresh on the browser, I get a clean screen that will let me add a new record.
Note that if I navigate to existing records and make changes, they do get saved properly.
Is there some hack I can do to clear the cache when I click the + ?
The graph only contains one thing, the view:
public class SSGCRRecordServiceTypeLinks : PXGraph<SSGCRRecordServiceTypeLinks, SSGCRServTypeRecTypeXR>
{
public SelectFrom<SSGCRServTypeRecTypeXR>.View ServTypeRecTypeLinks;
This is the DAC for the table:
[Serializable]
[PXCacheName("Record Type / Service Type XR")]
public class SSGCRServTypeRecTypeXR : IBqlTable
{
#region ID
[PXDBIdentity]
public virtual int? ID { get; set; }
public abstract class iD : PX.Data.BQL.BqlInt.Field<iD> { }
#endregion
#region RecordTypeID
[PXDBInt(IsKey = true)]
[PXDefault]
[PXUIField(DisplayName = "Record Type")]
[PXSelector(typeof(Search<SSGCRRecordType.recordTypeID>),
typeof(SSGCRRecordType.recordTypeCD),
typeof(SSGCRRecordType.description),
typeof(SSGCRRecordType.isActive),
SubstituteKey = typeof(SSGCRRecordType.recordTypeCD),
DescriptionField = typeof(SSGCRRecordType.description))]
public virtual int? RecordTypeID { get; set; }
public abstract class recordTypeID : PX.Data.BQL.BqlInt.Field<recordTypeID> { }
#endregion
#region ServiceTypeID
[PXDBInt(IsKey = true)]
[PXDefault]
[PXUIField(DisplayName = "Service Type")]
[PXSelector(typeof(Search<SSGCRServiceType.serviceTypeID>),
typeof(SSGCRServiceType.serviceTypeCD),
typeof(SSGCRServiceType.description),
typeof(SSGCRServiceType.isActive),
SubstituteKey = typeof(SSGCRServiceType.serviceTypeCD),
DescriptionField = typeof(SSGCRServiceType.description))]
public virtual int? ServiceTypeID { get; set; }
public abstract class serviceTypeID : PX.Data.BQL.BqlInt.Field<serviceTypeID> { }
#endregion
#region IsActive
[PXDBBool()]
[PXDefault(true)]
[PXUIField(DisplayName = "Active")]
public virtual bool? IsActive { get; set; }
public abstract class isActive : PX.Data.BQL.BqlBool.Field<isActive> { }
#endregion
#region CreatedByID
[PXDBCreatedByID()]
public virtual Guid? CreatedByID { get; set; }
public abstract class createdByID : PX.Data.BQL.BqlGuid.Field<createdByID> { }
#endregion
#region CreatedByScreenID
[PXDBCreatedByScreenID()]
public virtual string CreatedByScreenID { get; set; }
public abstract class createdByScreenID : PX.Data.BQL.BqlString.Field<createdByScreenID> { }
#endregion
#region CreatedDateTime
[PXDBCreatedDateTime()]
public virtual DateTime? CreatedDateTime { get; set; }
public abstract class createdDateTime : PX.Data.BQL.BqlDateTime.Field<createdDateTime> { }
#endregion
#region LastModifiedByID
[PXDBLastModifiedByID()]
public virtual Guid? LastModifiedByID { get; set; }
public abstract class lastModifiedByID : PX.Data.BQL.BqlGuid.Field<lastModifiedByID> { }
#endregion
#region LastModifiedByScreenID
[PXDBLastModifiedByScreenID()]
public virtual string LastModifiedByScreenID { get; set; }
public abstract class lastModifiedByScreenID : PX.Data.BQL.BqlString.Field<lastModifiedByScreenID> { }
#endregion
#region LastModifiedDateTime
[PXDBLastModifiedDateTime()]
public virtual DateTime? LastModifiedDateTime { get; set; }
public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
#endregion
#region Tstamp
[PXDBTimestamp()]
public virtual byte[] Tstamp { get; set; }
public abstract class tstamp : PX.Data.BQL.BqlByteArray.Field<tstamp> { }
#endregion
#region Noteid
[PXNote()]
public virtual Guid? Noteid { get; set; }
public abstract class noteid : PX.Data.BQL.BqlGuid.Field<noteid> { }
#endregion
This is the table in SQL:
CREATE TABLE [dbo].[SSGCRServTypeRecTypeXR](
[CompanyID] [int] NOT NULL,
[id] [int] IDENTITY(1,1) NOT NULL,
[RecordTypeID] INT NOT NULL,
[ServiceTypeID] INT NOT NULL,
[IsActive] [bit] NULL,
[CreatedByID] [uniqueidentifier] NOT NULL,
[CreatedByScreenID] [char](8) NOT NULL,
[CreatedDateTime] [datetime] NOT NULL,
[LastModifiedByID] [uniqueidentifier] NOT NULL,
[LastModifiedByScreenID] [char](8) NOT NULL,
[LastModifiedDateTime] [datetime] NOT NULL,
[tstamp] [timestamp] NOT NULL,
[NoteID] [uniqueidentifier] NULL,
CONSTRAINT [SSGCRServTypeRecTypeXR_PK] PRIMARY KEY CLUSTERED
(
[CompanyID] ASC,
--[id] ASC
[RecordTypeID]ASC,
[ServiceTypeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [primary]
) ON [primary]
GO