Skip to main content

Hoping someone can see what I’m doing wrong here.  I have added a Category field to the License Types Screen (FS200900) and am trying to get it to populate Read-only to the License Screen (FS201000).

 

I have tried this a number of ways but can’t get it to work.  Here is my latest attempt which gives me an error 

 

“Error: Cannot create the ctl00_phF_form_CstPXSelector1 control.
The PXSelector attribute is missing for the UsrLicenseCategory field.”


namespace PX.Objects.FS
{
public class FSLicenseTypeExt : PXCacheExtension<PX.Objects.FS.FSLicenseType>
{
#region UsrLicenseCategory
oPXDBString(10)]
0PXUIField(DisplayName="Category")]
"PXStringList(new strings] {"C", "V", "O"}, new string}] { "Credential Service","Vaccine", "Other"})]
public virtual string UsrLicenseCategory { get; set; }
public abstract class usrLicenseCategory : PX.Data.BQL.BqlString.Field<usrLicenseCategory> { }
#endregion
}
}


namespace PX.Objects.FS
{

public class FSLicenseExt : PXCacheExtension<PX.Objects.FS.FSLicense>
{
#region UsrLicenseCategory
oPXString]
nPXUIField(DisplayName = "Category")]
"PXDBScalar(typeof(
Search<FSLicenseTypeExt.usrLicenseCategory,
Where<FSLicenseType.licenseTypeID, Equal<FSLicense.licenseTypeID>>>))]
public string UsrLicenseCategory { get; set; }
public abstract class usrLicenseCategory : PX.Data.BQL.BqlString.Field<usrLicenseCategory> { }
#endregion
}
}

 

Thanks in advance!

 

Greg

I think you just need to go into the Project XML, search for CstPXSelector1, make sure it is related to your custom field, and then change the PXSelector to PXTextEdit.  Save that and publish and you should be able edit the form after that.

 


 


Your code worked for me. Also add the dropdown definition on the read only field to display the description value and not the code:

 

 


Thank you both for the help I have it working now but it only seems to update when I save and then reopen the record.  Do you know what changes I would need to make to get it to auto update when the License Type is selected?


Please add an FieldUpdated event on License Type and then update the read only field (Similar BQL than PBDBScalar)


Reply