Customization of leads screen


Userlevel 2
Badge

Do anyone have any idea how we can customize the existing fields. I need to customize source dropdown for the Leads screen need to add a few more options to that dropdown.


10 replies

Userlevel 2
Badge

If anyone has doubts I want to options for this dropdown. Does anyone have any leads ??

 

 

Userlevel 6
Badge +4

I don’t work in that screen, but I do have some combo boxes that I override the list.  Just be sure you don’t need to account for business logic for different options.

When the record is selected, use SetList from PXStringListAttribute to replace the allowed values and allowed labels.  Then add a class for your new selection list and inherit from PXStringListAttribute.  Add an array for the allowed values and another for their respective labels.  See below for an example.

#region MyDAC_RowSelected
protected void _(Events.RowSelected<MyDAC> e)
{
MyDAC row = (MyDAC)e.Row;
SelectableDispositions listattr = new();
PXStringListAttribute.SetList<MyDAC.disposition>(e.Cache, row, listattr.AllowedValues, listattr.AllowedLabels);
}
#endregion

#region SelectableDispositions
public class SelectableDispositions : PXStringListAttribute
{
public class ListAttribute : PXStringListAttribute
{
public ListAttribute() : base(
new[]
{
Pair(MyDAC.Dispositions.None, MyNS.IN.Messages.None),
Pair(MyDAC.Dispositions.Disp1, MyNS.IN.Messages.Disp1),
Pair(MyDAC.Dispositions.Disp2, MyNS.IN.Messages.Disp2),
Pair(MyDAC.Dispositions.Disp3, MyNS.IN.Messages.Disp3),
})
{ }

}

public string[] AllowedLabels = new string[]
{
MyNS.IN.Messages.None,
MyNS.IN.Messages.Disp1,
MyNS.IN.Messages.Disp2,
MyNS.IN.Messages.Disp3
};

public string[] AllowedValues = new string[]
{
MyDAC.Dispositions.None,
MyDAC.Dispositions.Disp1,
MyDAC.Dispositions.Disp2,
MyDAC.Dispositions.Disp3
};
}
#endregion

In my case, I define the combo box list with all my options initially, but then I want to remove certain options for the user to select, so I override the list using the code sample above to define only the options I want the user to select at the time.

Userlevel 7
Badge +17

Hi @param2022 @Brian Stevens  For this requirement, coding is NOT required, we can even achieve this with Workflow automation steps. Please find the details below.

  • Add the Leads screen to the Customization project
  • Then add the Combox box values to the Source field in the Fields section
  • Inherit the Default Workflow and then add these new combobox values to the each step like shown in the screenshot.

Please find the screenshots for reference, also, attached customization package for your reference.

 

 

 

 

Userlevel 2
Badge

@Naveen Boga Thank you so much for the reply. I am following steps you said but cannot find the SOURCE field on the fields tab. I need to add it manually and when I get it as new field and not inherited. And new field does not have the option COMBO BOX VALUES, while the old ones Status and Resolution do have them.

 

 

Userlevel 7
Badge +17

Hi @param2022  Yes, you need to add it manually and then click on the COMBO BOX Values and then add the custom source fields.

Then after, as indicated above you need to inherit the default workflow and add these to each status of each workflow step. 

Userlevel 2
Badge

@Naveen Boga this worked thank you.

 

Userlevel 6
Badge +4

Be cautious with upgrades when you do this in the GUI version of workflow.  We switched to code-based workflow recently because every upgrade had issues when the workflows would not allow us to upgrade naturally.  We had to recreate the GUI workflow every time until I wrote them in code, and now no issues with upgrades.  I do not have an example of how to write this in code on workflow.

Userlevel 2
Badge

@Brian Stevens @Naveen Boga 

 

I think both of the ways are applicable if you have only one dropdown. But I came to know that there are multiple places where this dropdown is used. So I need to find all the instances where this was used and do all the process. I looked into source code and found that they have created an attribute for the source field [CRMSources] and there they are declaring the options in PXStringList If by any way we can override that we don’t need to make changes at multiple places.

Userlevel 6
Badge +4

If you want to replace the list globally everywhere that field of the DAC is used, you will want to use a DAC extension and replace the defined list with your own.  You should be able to remove the current list with PXRemoveBaseAttribute and append an attribute of your new list.  Something like this, assuming you know how to make your new list attribute…

[PXMergeAttributes(Method = MergeMethod.Append)]
[PXRemoveBaseAttribute(typeof(CRMSourcesAttribute))]
[MyCRMSourcesAttribute.List]
public String Source { get; set; }

The bigger question is, do you want to replace it only for CRLead as used on that screen or for the base DAC of CR.Contact which has a vastly larger presence in the system?  That would determine if you need to apply the DAC extension on CRLead or on Contact.

Userlevel 2
Badge

@Brian Stevens only for leads class. As for your solution I will still have to add this code on multiple places. Can we update CRMSources in any way directly ?

 

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