Skip to main content
Solved

Property set method not found when trying to change string field lengh and mask a field in PMAccess Screen

  • 31 December 2021
  • 1 reply
  • 150 views

aaghaei
Captain II
Forum|alt.badge.img+9

Hello There,

 

I need to change a field mask to match with my Projects mask but i’m getting the below error. I tried customizing the base attributes through graph cachattached but I get the same error. Here is the error:

 Property set method not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Property set method not found.

Source Error:


Line 959:				{
Line 960:					PXDataSource datasource = ((PXPage)this.Page).DefaultDataSource;
Line 961:					if (datasource != null && PX.Data.Process.PXAuditHelper.IsInfoAvailable(datasource.DataGraph, datasource.PrimaryView))
Line 962:					{
Line 963:						PXCache cache = datasource.DataGraph.Views[datasource.PrimaryView].Cache;


Source File: C:\Acumatica\LarkGroup\Controls\PageTitle.ascx.cs    Line: 961

Stack Trace:


[ArgumentException: Property set method not found.]
   PX.Data.PXGraph.CreateInstance(Type graphType, String prefix) +1144
   PX.Web.UI.PXBaseDataSource.CreateDataGraphAsSingleton(Type type) +560
   PX.Web.UI.PXBaseDataSource.CreateDataGraph(Type type) +175
   PX.Web.UI.PXBaseDataSource.get_DataGraph() +412
   User_PageTitle.InitAuditMenu() in C:\Acumatica\LarkGroup\Controls\PageTitle.ascx.cs:961
   User_PageTitle.Page_InitComplete(Object sender, EventArgs e) in C:\Acumatica\LarkGroup\Controls\PageTitle.ascx.cs:318
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnInitComplete(EventArgs e) +138
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2203

 

and here is my graph and cachext.

    public class PMAccess_Extension : PXGraphExtension<PMAccess>
    {
        #region Event Handlers
        protected void RelationGroup_GroupName_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
        {
            var row = e.Row as RelationGroup;

            if (row != null)
            {
                if (row.GroupName != null)
                {
                    row.GroupName = row.GroupName.PadLeft(6, '0');
                }
            }
        }
        #endregion
    }



    public class SMRelationGroup_Extension : PXCacheExtension<PX.SM.RelationGroup>
    {
        #region GroupName  
        [PXMergeAttributes(Method = MergeMethod.Append)]
        [PXCustomizeBaseAttribute(typeof(PXDBStringAttribute), nameof(PXDBStringAttribute.Length), 6)]
        [PXCustomizeBaseAttribute(typeof(PXDBStringAttribute), nameof(PXDBStringAttribute.InputMask), "AA-AAA-A")]
        public string GroupName { get; set; }
        #endregion
    }

 

Best answer by aaghaei

Not sure why but I replaced Field’s whole properties and resolved.

    public class SMRelationGroup_Extension : PXCacheExtension<PX.SM.RelationGroup>
    {
        #region GroupName  
        public abstract class groupName : PX.Data.BQL.BqlString.Field<groupName> { }
        protected String _GroupName;
        [PXMergeAttributes(Method = MergeMethod.Replace)]
        [PXDBString(6, IsKey = true, InputMask = ">AA-AAA-A")]
        [PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
        [PXSelector(typeof(Search<RelationGroup.groupName, Where<RelationGroup.active, Equal<True>>, OrderBy<Desc<RelationGroup.groupName>>>))]
        [PXUIField(DisplayName = "Group Name", Visibility = PXUIVisibility.SelectorVisible, Required = true, Enabled = true, Visible = true)]
        public String GroupName
        {
            get
            {
                return this._GroupName;
            }
            set
            {
                this._GroupName = value;
            }
        }
        #endregion
    }

 

View original
Did this topic help you find an answer to your question?

1 reply

aaghaei
Captain II
Forum|alt.badge.img+9
  • Author
  • Captain II
  • 1178 replies
  • Answer
  • December 31, 2021

Not sure why but I replaced Field’s whole properties and resolved.

    public class SMRelationGroup_Extension : PXCacheExtension<PX.SM.RelationGroup>
    {
        #region GroupName  
        public abstract class groupName : PX.Data.BQL.BqlString.Field<groupName> { }
        protected String _GroupName;
        [PXMergeAttributes(Method = MergeMethod.Replace)]
        [PXDBString(6, IsKey = true, InputMask = ">AA-AAA-A")]
        [PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
        [PXSelector(typeof(Search<RelationGroup.groupName, Where<RelationGroup.active, Equal<True>>, OrderBy<Desc<RelationGroup.groupName>>>))]
        [PXUIField(DisplayName = "Group Name", Visibility = PXUIVisibility.SelectorVisible, Required = true, Enabled = true, Visible = true)]
        public String GroupName
        {
            get
            {
                return this._GroupName;
            }
            set
            {
                this._GroupName = value;
            }
        }
        #endregion
    }

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings