I’ve added some custom fields to the Company editing screen inside Configuration that I need to access in a graph extension and a custom service class. The fields were created as a DAC extension on Organization. These fields are used to store company specific URLs to third party APIs.
The thing I’d like help with is coming up with a way to get to the current organization without hard coding the OrganizationCD into my FBQL query. This is what is working for me currently:
var organization =
SelectFrom<Organization>
.Where<Organization.organizationCD.IsEqual<@P.AsString>>
.View
.Select(Base, "MY_ORGANIZATION_CD")
.RowCast<Organization>()
.FirstOrDefault();
Is there a better way to do this without using MY_ORGANIZATION_CD as a string?
Originally, I was hoping I could use the CompanyID from PXInstanceHelper.CurrentCompany but IntelliSense suggests it isn’t possible to query for records using the CompanyID column. Ideally, I’d like something that isn’t going to be expensive in terms of processing time.
Best answer by Marco Villasenor
View original