Solved

About Customization in Contact PopUpForm of ContactGrid in Customer Screen


Hi, 

I want to Customize Contact Popup Form of Contact Grid in Customer Screen, so  i added one custom Field  in that Popup form ,while creating contact custom column value not updating to the Contact Table, please suggest me on this

icon

Best answer by Dioris Aguilar 4 April 2022, 17:07

View original

12 replies

Userlevel 2

Hello @dharmendarm43, I would suggest you to look at the following things in your customization:

  1. Check if the Custom Column has been created as a part of Customization - use Add Custom Column to Table in Customization Project Editor to add the new column.
  2. Verify if the column has been created in the table in the SQL Server.
  3. Check if the property in the DAC is PXDBBool attribute or not. 

After this, if you still have the issue, it would be helpful if you can provide more information or code for us to review. 

Hi @VidhyaHariharasu00 ,Actually i followed all three steps you mentioned above, Actually i created custom column for Contact DAC ,it is working in Contact screen (means newly added custom field is saving to the DB), but we have ability to add contact in customer screen also , in that customer screen we have one Contact Grid ,in that grid we have Plus Button to create contact, after clicking on that button it will open one dialogue box with Some Columns like FirstName,LastName,Email etc…,actually i placed newly added column in that popup,and that popup DAC is ContactFilter,So I created one DAC Extension for this Filter DAC for adding new Feild,

Note :ContactFilter is not Actual DAC,Actual DAC is Contcat

 

Note :Actually we can create contact in multiple screens, those are

1)Contact screen:   I added custom column in Actual DAC(Contact)  and its working in Contact Screen

 public  class KNBCContactExt :PXCacheExtension<Contact>
    {

        //public static bool IsActive() { return true; }

        #region UsrKNIsBigCExport 
        [PXDBBool()]
        [PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
        [PXUIField(DisplayName = "Enable for BigCommerce Export")]
        public bool? UsrKNIsBigCExport { get; set; }
        public abstract class usrKNIsBigCExport : BqlBool.Field<usrKNIsBigCExport> { }
        #endregion
    }

Contact Screen

2)Customer screen (in the Contact grid we have plus icon to create contact,when you click on that popup form will be open )

public  class KNBCContactFilterExt : PXCacheExtension<ContactFilter>
    {

        #region UsrKNIsBigCExport 
        [PXDBBool()]
        [PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
        [PXUIField(DisplayName = "Enable for BigCommerce Export"]
        public bool? UsrKNIsBigCExport { get; set; }
        public abstract class usrKNIsBigCExport : BqlBool.Field<usrKNIsBigCExport> { }
        #endregion
    }

Customer Screen

 

Userlevel 5
Badge +2

@dharmendarm43 I’d suggest to implement a DAC extension as follows:

public class CustomExampleCreateContactFromCustomerGraphExt : PXGraphExtension<CustomerMaint.CreateContactFromCustomerGraphExt, CustomerMaint>
{
protected override void OnBeforePersist(TTargetGraph graph, TTarget entity)
{
//Add code to take the value from the popup to the TTarget entity.
//You should have available the ContactInfo view with the ContactFilter DAC where the checkbox in the popup should be available as a DAC extension.
}
}

 

Hi @Dioris Aguilar , as suggested by you when i am trying to create class, i  am getting bellow compile time error

 

 

Userlevel 5
Badge +2

@dharmendarm43 Please, substitute the OnBeforePersist as follows: 

protected override void OnBeforePersist(ContactMaint graph, Contact entity)
{
//Add code here
}

 

Hi @Dioris Aguilar ,i did same but ,below error came like ‘no suitable method found’

 

Userlevel 5
Badge +2

@dharmendarm43 There’s a missing PXOverride attribute, try the following code:

public class CustomExampleCreateContactFromCustomerGraphExt : PXGraphExtension<CustomerMaint.CreateContactFromCustomerGraphExt, CustomerMaint>
{
[PXOverride]
public void OnBeforePersist(ContactMaint graph, Contact entity)
{
//Add code here
}
}

 

Hi @Dioris Aguilar  i did same as above , in the code level i did not get any compile time error, but while  loading Customer page i am getting below error

 

 

GraphExtension

using PX.Data;
using PX.Objects.AR;
using PX.Objects.CR;
using PX.Objects.CR.Extensions.CRCreateActions;

namespace KNBS
{
    public class CustomExampleCreateContactFromCustomerGraphExt :
        PXGraphExtension<CustomerMaint.CreateContactFromCustomerGraphExt, CustomerMaint>
    {
        [PXOverride]
        public void OnBeforePersist(ContactMaint graph, Contact entity)
        {

        }
       
    }
}

 

Userlevel 5
Badge +2

@dharmendarm43 It seems to be a version issue, what is the Acumatica version you are working on? 

hi @Dioris Aguilar ,my acumatica version is  2020 R2 Build 20.206.0011

Userlevel 5
Badge +2

@dharmendarm43 For 2020R2 you should do it as follows since the OnBeforePersist method was added in 2021R1:

public class CustomExampleCreateContactFromCustomerGraphExt :
PXGraphExtension<CustomerMaint.CreateContactFromCustomerGraphExt, CustomerMaint>
{
public delegate Contact CreateMasterDelegate(ContactMaint graph, ContactConversionOptions _);
[PXOverride]
public Contact CreateMaster(ContactMaint graph, ContactConversionOptions _, CreateMasterDelegate baseMethod)
{
var contact = baseMethod(graph, _);
var filterPopup = Base1.ContactInfo.Current;
return contact;

}
}

Base1.ContactInfo is the ContactFilter with the data in the New Contact popup.

Hi @Dioris Aguilar , its working fine, thank you so much

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved