Solved

How to add "Inventory" Type of "Source" Role in "RELATIONS" Tab on Cases screen ?

  • 12 December 2023
  • 3 replies
  • 60 views

Userlevel 3
Badge

Dear Team,

How to add "Inventory" Type of "Source" Role in "RELATIONS" Tab on Cases screen ?

 

The expected results are as follows:

 

Best Regards,

NNT

icon

Best answer by andriikravetskyi35 13 December 2023, 11:45

View original

3 replies

Userlevel 5
Badge +1

Hi,

I did it in fast way and my stringList will have always the same values, but you might use my logic as template and add your custom list, that depends from type:

 public class CRCaseMaintExt : PXGraphExtension<PX.Objects.CR.CRCaseMaint> 
{
[PXMergeAttributes(Method = MergeMethod.Merge)]
[TestInheristanceClass(typeof(PX.Objects.CR.CRRelation.role))]
protected virtual void _(Events.CacheAttached<PX.Objects.CR.CRRelation.targetType> e) { }
}
public class TestInheristanceClass : PX.Objects.CR.CRRelationTypeListAttribure
{
public TestInheristanceClass(Type RoleType) : base(RoleType)
{

}

public override void FieldSelecting(PXCache sender, PXFieldSelectingEventArgs e)
{
base.FieldSelecting(sender, e);

// string text = sender.GetValue(e.Row, base.RoleType.Name) as string;
// Item targetType = GetTargetType(text);
e.ReturnState = (PXStringState)PXStringState.CreateInstance(e.ReturnState, null, null, _FieldName, null, -1, null,new string[]{ "1","2"},new string[] { "a", "b"}, true, null, null);
//if (e.Row != null)
//{
// ((PXFieldState)e.ReturnState).Enabled = ((PXFieldState)e.ReturnState).Enabled && text != null;
//}
}
}

 

Userlevel 7
Badge +17

@nhatnghetinh  Please refer to the below article and helps to your requirement.

 

https://riptutorial.com/acumatica/example/29102/modifying-marital-statuses

Userlevel 7
Badge +4

@nhatnghetinh,

Quick tip: To modify the list of Type field, you have to inherit the CRRelationTypeListAttribure attribute and make changes to it. Good Luck,

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