Skip to main content

Hello,

How do I customize the behavior of Role and Type under Relation tab of Business Account? I add new role via Automation Steps below but how can I default a Type based on Role selected? For example if IT Consultant is selected in Role the default Type is Prospect.

 

 

Hi @kristianharianja,

We can achieve this by having small customization. Based on the ROLE, we have default a type.

Please find the customization code below.


public class BusinessAccountMaintExt : PXGraphExtension<BusinessAccountMaint>
{
protected virtual void CRRelation_TargetType_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e, PXFieldDefaulting InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(sender, e);
var row = (CRRelation)e.Row;
if (row == null) return;

if (row.Role == "ITConsultant")
{
e.NewValue = "Prospect";
}
}
}

Hope this helps!!


Thank you!


Reply