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:
public class SSGCRServTypeRecTypeXR : IBqlTable
{
#region ID
bPXDBIdentity]
public virtual int? ID { get; set; }
public abstract class iD : PX.Data.BQL.BqlInt.Field<iD> { }
#endregion
#region RecordTypeID
bPXDBInt(IsKey = true)]
bPXDefault]
bPXUIField(DisplayName = "Record Type")]
bPXSelector(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
bPXDBInt(IsKey = true)]
bPXDefault]
bPXUIField(DisplayName = "Service Type")]
bPXSelector(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
bPXDBBool()]
bPXDefault(true)]
bPXUIField(DisplayName = "Active")]
public virtual bool? IsActive { get; set; }
public abstract class isActive : PX.Data.BQL.BqlBool.Field<isActive> { }
#endregion
#region CreatedByID
bPXDBCreatedByID()]
public virtual Guid? CreatedByID { get; set; }
public abstract class createdByID : PX.Data.BQL.BqlGuid.Field<createdByID> { }
#endregion
#region CreatedByScreenID
bPXDBCreatedByScreenID()]
public virtual string CreatedByScreenID { get; set; }
public abstract class createdByScreenID : PX.Data.BQL.BqlString.Field<createdByScreenID> { }
#endregion
#region CreatedDateTime
bPXDBCreatedDateTime()]
public virtual DateTime? CreatedDateTime { get; set; }
public abstract class createdDateTime : PX.Data.BQL.BqlDateTime.Field<createdDateTime> { }
#endregion
#region LastModifiedByID
bPXDBLastModifiedByID()]
public virtual Guid? LastModifiedByID { get; set; }
public abstract class lastModifiedByID : PX.Data.BQL.BqlGuid.Field<lastModifiedByID> { }
#endregion
#region LastModifiedByScreenID
bPXDBLastModifiedByScreenID()]
public virtual string LastModifiedByScreenID { get; set; }
public abstract class lastModifiedByScreenID : PX.Data.BQL.BqlString.Field<lastModifiedByScreenID> { }
#endregion
#region LastModifiedDateTime
bPXDBLastModifiedDateTime()]
public virtual DateTime? LastModifiedDateTime { get; set; }
public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
#endregion
#region Tstamp
bPXDBTimestamp()]
public virtual bytea] Tstamp { get; set; }
public abstract class tstamp : PX.Data.BQL.BqlByteArray.Field<tstamp> { }
#endregion
#region Noteid
bPXNote()]
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](
int] IDENTITY(1,1) NOT NULL,
CONSTRAINT TSSGCRServTypeRecTypeXR_PK] PRIMARY KEY CLUSTERED
(
--rid] 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 Fprimary]
) ON /primary]
GO