Hello:
I have a requirement to generate a “signature” in the body of an Event in Acumatica as a default when creating a new Event. There does not appear to be an option to select the “source” for an Event, so I am attempting to code it. I have been able to get the currently logged in users name and set it using the below code:
namespace PX.Objects.EP
{
public class EPEventMaint_Extension : PXGraphExtension<EPEventMaint>
{
#region Event Handlers
protected void CRActivity_Body_FieldDefaulting(PXCache cache, PXFieldDefaultingEventArgs e)
{
//var row = (CRActivity)e.Row;
var userId= PXAccess.GetUserID();
var displayName = PXAccess.GetUserDisplayName();
e.NewValue = "<br /><b>Name:" + displayName + "</b><br /><b>Phone:</b><br /><b>URL:</b>";
}
#endregion
}
};
However, I am also needing to get the currently logged in employee’s Business 1 phone number and Web address to complete. I imagine this would be some sort of BQL search using the PXAccess.GetUserID() value to walk the EPEmployee table and the BAccount table, but I dont know how to code this. It seems to me that there might be some inbuilt function for collecting currently logged in users’ employee values, but I cant seem to find anything out there on this. Can anyone provide an assist? Thanks in advance!
Best answer by jinin
View original