Skip to main content
Answer

CountryOfOrigin from InventoryItem in SalesOrder Detail Section

  • July 28, 2025
  • 4 replies
  • 73 views

Bravo94
Freshman I
Forum|alt.badge.img

Hi Guys,

 

i want the Field CountryOfOrigin in the Soorder Detail Section.

 

i tried it with a User Defined Field , but PXFormular is not working.

 

namespace PX.Objects.SO
{
  public class SOLineExt : PXCacheExtension<PX.Objects.SO.SOLine>
  {

    #region UsrUrsprungsland
    [PXDBString(200)]
    [PXUIField(DisplayName="Ursprungsland")]
    [PXFormula(typeof(Selector<SOLine.inventoryID,InventoryItemExt.CountryOfOrigin>))]
  
    public virtual string UsrUrsprungsland { get; set; }
    public abstract class usrUrsprungsland : PX.Data.BQL.BqlString.Field<usrUrsprungsland> { }
    #endregion

    
  }
}

 

 

 

Hope u can help me.

Best answer by DipakNilkanth

Hi ​@Bravo94,

Just noticed that you're accessing the Country of Origin field from the extension, but this field is actually part of the base table, not the extension.

So, you need to replace this line:

[PXFormula(typeof(Selector<SOLine.inventoryID, InventoryItemExt.CountryOfOrigin>))]

With this:

[PXFormula(typeof(Selector<SOLine.inventoryID, InventoryItem.countryOfOrigin>))]

Make sure to publish the changes after updating the formula.

4 replies

DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi ​@Bravo94,

Have you set the “Commit Changes” property to True for the custom field from the Customization editor?
If not, please try setting it to True, then publish the customization package and confirm whether the issue is resolved.
Hope, it helps!


Bravo94
Freshman I
Forum|alt.badge.img
  • Author
  • Freshman I
  • July 28, 2025

change “Commit Changes” to true, bit it stoll not working.

 

i get this Error:

 

[2025-07-28 13:32:33.113] \App_RuntimeCode\PX_Objects_PO_POSiteStatusSelected_extensions.cs(50): warning CS0436: The type 'InventoryItemExt' in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs' conflicts with the imported type 'InventoryItemExt' in 'C141515, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs'.
[2025-07-28 13:32:33.113] \App_RuntimeCode\PX_Objects_SO_SOOrderSiteStatusSelected_extensions.cs(17): warning CS0436: The type 'InventoryItemExt' in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs' conflicts with the imported type 'InventoryItemExt' in 'C141515, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs'.
[2025-07-28 13:32:33.114] \App_RuntimeCode\PX_Objects_SO_SOLine_extensions.cs(33): warning CS0436: The type 'InventoryItemExt' in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs' conflicts with the imported type 'InventoryItemExt' in 'C141515, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs'.
[2025-07-28 13:32:33.114] \App_RuntimeCode\PX_Objects_SO_SOLine_extensions.cs(41): warning CS0436: The type 'InventoryItemExt' in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs' conflicts with the imported type 'InventoryItemExt' in 'C141515, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs'.
[2025-07-28 13:32:33.115] \App_RuntimeCode\PX_Objects_SO_SOLine_extensions.cs(41): error CS0426: The type name 'CountryOfOrigin' does not exist in the type 'InventoryItemExt'
[2025-07-28 13:32:33.115] \App_RuntimeCode\PX_Objects_SO_SOLine_extensions.cs(49): warning CS0436: The type 'InventoryItemExt' in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs' conflicts with the imported type 'InventoryItemExt' in 'C141515, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Instanzen\MBA\Website\Customization\FilesValidation\FilesWebsite\App_RuntimeCode\PX_Objects_IN_InventoryItem_extensions.cs'.
[2025-07-28 13:32:33.119] \App_RuntimeCode\PX_Objects_SO_SOLine_extensions.cs(41): error CS0426: The type name 'CountryOfOrigin' does not exist in the type 'InventoryItemExt'
[2025-07-28 13:32:33.122] Compiler time, in seconds: 5,3799305
[2025-07-28 13:32:33.122] Validation failed.

DipakNilkanth
Pro III
Forum|alt.badge.img+13
  • Pro III
  • Answer
  • July 28, 2025

Hi ​@Bravo94,

Just noticed that you're accessing the Country of Origin field from the extension, but this field is actually part of the base table, not the extension.

So, you need to replace this line:

[PXFormula(typeof(Selector<SOLine.inventoryID, InventoryItemExt.CountryOfOrigin>))]

With this:

[PXFormula(typeof(Selector<SOLine.inventoryID, InventoryItem.countryOfOrigin>))]

Make sure to publish the changes after updating the formula.


Bravo94
Freshman I
Forum|alt.badge.img
  • Author
  • Freshman I
  • July 28, 2025

Thank u very much <3