I have a InvoiceAccount field in table. And another field in this table is PackingSlipAXType. If PackingSlipAXType is Sales, InvoiceAccount field value is customer account. If type is PurchReturn, InvoiceAccount field value is vendor account.
When value is customer account, when right click and go to main table i want to go Customer and When value is vendor account, when right click and go to main table i want to go vendor.
How can i do this in same field?
There are two primary ways. One is code and the other is using native MorphX
and Conditional Table Relations
. Code gives you more flexibility, but conditional table relations are simpler and "just work".
Using conditional table relations. I created a new table and AccountNum
would represent a customer or vendor account, and the base enum SalesPurch
is used to indicate if it is a Customer Account (Sales) or a Vendor Account (Purch). Similar to your setup.
You will likely want both a jumpRef
and a lookup
to both go to the correct main table and lookup the correct values.. This is code, but you have all the flexibility in the world...but may not need it.
\Data Dictionary\Tables\TmpCostAllocationBase_RU\Methods\jumpRefAgreement
\Data Dictionary\Tables\TmpCostAllocationBase_RU\Methods\lookupAgreement