Dear Team,
I have created a Custom field (UsrContactPhone) on the Cases screen to display the Contact's phone number.
I used FieldSelecting Event to do this. The result displayed the value of Custom field (UsrContactPhone) on the Cases screen, but checking the ‘CRCase’ table on the SQL Database, the Custom field (UsrContactPhone) value is NULL.
I think the problem is the return value ‘e.ReturnValue’ is not okay but I don't have a solution yet.
I would like data of the Custom field to be saved to the SQL Database.
Please help me with the solution !
Best Regards,
NNT
==============
protected void CRCase_UsrContactPhone_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e, PXFieldSelecting InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (CRCase)e.Row;
if (row == null)
{
return;
}
Contact contact = PXSelect<Contact,
Where<Contact.contactID, Equal<Required<Contact.contactID>>>>.Select(Base, row.ContactID);
if (contact == null) { return; }
e.ReturnValue = contact.Phone1 ;
Base.Case.View.RequestRefresh();
}
==============
Best answer by vardan22
View original