Solved
i need to fetch Attention, Email, Phone1 and Phone2 from Contact (Companies) in any graph any time
Best answer by Naveen Boga
PX.Objects.CR.BAccount objBAccount = PXSelectJoin<PX.Objects.CR.BAccount,
InnerJoin<Organization, On<Organization.bAccountID, Equal<PX.Objects.CR.BAccount.bAccountID>>,
InnerJoin<PX.Objects.GL.Branch,On<PX.Objects.GL.Branch.organizationID,Equal<Organization.organizationID>>>>,
Where<PX.Objects.GL.Branch.branchID,Equal<Required<PX.Objects.GL.Branch.branchID>>>>.
Select(customerMaint, customerMaint.Accessinfo?.BranchID);
if (objBAccount != null)
{
OrganizationMaint OMaint = PXGraph.CreateInstance<OrganizationMaint>();
OrganizationBAccount OBAccount = PXSelect<OrganizationBAccount, Where<OrganizationBAccount.bAccountID,
Equal<Required<OrganizationBAccount.bAccountID>>>>.Select(OMaint, objBAccount?.BAccountID);
if (OBAccount != null)
{
OMaint.BAccount.Current = OBAccount;
PX.Objects.CR.Address MainAddress = OMaint.GetExtension<OrganizationMaint.DefContactAddressExt>().DefAddress.Select()[0];
PX.Objects.CR.Contact MainContact = OMaint.GetExtension<OrganizationMaint.DefContactAddressExt>().DefContact.Select()[0];
// Get The Address Details from MainAddress object
//Get the Contact Details from MainContact object
}
}
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.