Hi @joe21Â
Â
You can create a SQL View with well defined column names that consume the corresponding UDF columns ( User Defined Function ?). Then having the DAC is routine.
@Leonardo JustinianoÂ
Great idea. Thanks for that! That would be super easy.
@Leonardo Justiniano gave me solution to my original issue. I implemented the advice and it was working great.
After re-working the customization, I changed the UDF fields to be of type INT rather than CHAR. This solution was working before, but now that I changed the fields to INT (using ID’s rather than strings), it does not work any longer.
It is a super simple SQL View. When I do a select in Query Analyzer, it returns the expected result. But the View in the graph is not returning any data.
This is the SQL View:
CREATE VIEW Edbo]. SSGCRCaseUsrServiceTypeIDInUse]
ASÂ
   SELECTÂ
      CaseCD,Â
      UsrServiceTypeID
   FROMÂ
      dbo.CRCase
GO
The corresponding DAC is:
{
   eSerializable]
   {PXCacheName("CRCase UsrServiceTypeID In Use")]
   public class SSGCRCaseUsrServiceTypeIDInUse : IBqlTable
   {
      #region Casecd
      PXDBString(10, IsUnicode = true, InputMask = "")]
      SPXUIField(DisplayName = "Casecd")]
      public virtual string Casecd { get; set; }
      public abstract class casecd : PX.Data.BQL.BqlString.Field<casecd> { }
      #endregion
      #region UsrServiceTypeID
            public virtual int? UsrServiceTypeID { get; set; }
      public abstract class usrServiceTypeID : PX.Data.BQL.BqlInt.Field<usrServiceTypeID> { }
      #endregion
   }
}
Â
I tried using a view as follows but it doesn’t return any records when I check the view in the rowselected handler (just to test)
public SelectFrom<SSGCRCaseUsrServiceTypeIDInUse>.
Where<SSGCRCaseUsrServiceTypeIDInUse.usrServiceTypeID.
IsEqual<SSGCRServiceType.serviceTypeID.FromCurrent>>.View LinksExist;
Â
I also tried getting the data with this but it also comes back null
SSGCRCaseUsrServiceTypeIDInUse finditem = SelectFrom<SSGCRCaseUsrServiceTypeIDInUse>.
  Where<SSGCRCaseUsrServiceTypeIDInUse.usrServiceTypeID.IsEqual<@P.AsInt>>.
  View.Select(this, row.ServiceTypeID);
Â
While debugging, I verified that the row.ServiceTypeID has the correct value and that value exists in the CRCase table in the correct UDF.
I *could* go back and re-work it to store the CD value in the UDF as opposed to an INT value, but if anyone sees anything obviously wrong here, I’d rather not waste hours re-working it. Plus, I don’t know for sure if that will even solve the issue. It WAS working when searching by a string value.
Â
Hi @joe21Â
Please recompile the SQL view. SQL Servers store the mapping to the original column type when you create the view. Dropping and Recreating the view should solve the issue.
Â
Hi @Leonardo JustinianoÂ
That did the trick. Hopefully in two years when this happens again, I’ll find this post when I search for help. :-)
Thank you again.