Skip to main content
Answer

Why Aren't all Fields from [FSSODetSplit] available in Customization Editor?

  • May 22, 2024
  • 5 replies
  • 92 views

Forum|alt.badge.img

The form (PO505000) used to create a PO, we want to be able to apply a filter to the PONbr field, which belongs to the FSSODetSplit DAC.

It exists in the database:

 

But when trying to add this field to the screen, it is not available?

 

 

is there any way to make this visible?

 

Anyone know why they would be hiding this field?

Best answer by Zoltan Febert

Hi @mjgrice32,

Please try this code below.

POCreate screen uses FixedDemand projection, SM_POCreate extension joins FSSODetFSSODetSplit projection to this projection. So we need to extend this second projection, and enable our new field in GetFixedDemandFieldScope.

I see only one problem here: PONbr doesn’t exist at this point, because we are going to create the Purchase Order now.

// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class SM_POCreateExt : PXGraphExtension<SM_POCreate, POCreate>
{
[PXOverride]
public virtual IEnumerable<Type> GetFixedDemandFieldScope(Func<IEnumerable<Type>> baseFunc)
{
foreach (var r in baseFunc())
{
yield return r;
}
// Add these fields to the Field Scope so they can be used in the
// Customization screen
yield return typeof(FSSODetFSSODetSplitExt.usrPONbr);
}
}

// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class FSSODetFSSODetSplitExt : PXCacheExtension<FSSODetFSSODetSplit>
{
#region UsrPONbr
public abstract class usrPONbr : PX.Data.BQL.BqlString.Field<usrPONbr> { }
[PXDBString(15, IsUnicode = true, InputMask = "", BqlField = typeof(FSSODetSplit.pONbr))]
[PXUIField(DisplayName = "PO Order Nbr.")]
public virtual string UsrPONbr { get; set; }
#endregion
}

 

5 replies

Zoltan Febert
Jr Varsity I
Forum|alt.badge.img+3

Hi @mjgrice32,

 

POCreate graph uses a field scope to limit the queried fields from the database. You need to overwrite GetFixedDemandFieldScope in order to include your fields. FYI: in my Acumatica version POLineNbr belongs to FSSODet, it could be different in your instance.

 

public class SM_POCreateExt : PXGraphExtension<SM_POCreate, POCreate>
{

[PXOverride]
public virtual IEnumerable<Type> GetFixedDemandFieldScope(Func<IEnumerable<Type>> baseFunc)
{
foreach(var r in baseFunc())
{
yield return r;
}
yield return typeof(FSSODet.poLineNbr);
}
}

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • May 29, 2024

Hi @mjgrice32,

 

POCreate graph uses a field scope to limit the queried fields from the database. You need to overwrite GetFixedDemandFieldScope in order to include your fields. FYI: in my Acumatica version POLineNbr belongs to FSSODet, it could be different in your instance.

 

Hi Zontan,

Thank you so much for your reply. In my case, I am trying to get the FSSODetSplit.pONbr to show. IN the default filter shown in POCreate, FSSODet isn’t available.

I tried using this code, but the value still do not show up in the Customization screen. Any idea why?

    public class SM_POCreateExt : PXGraphExtension<SM_POCreate, POCreate>
{
public static bool IsActive()
{
return true;
}

[PXOverride]
public virtual IEnumerable<Type> GetFixedDemandFieldScope(Func<IEnumerable<Type>> baseFunc)
{
foreach (var r in baseFunc())
{
yield return r;
}
// Add these fields to the Field Scope so they can be used in the
// Customization screen
yield return typeof(FSSODetSplit.pONbr);
}
}

 


Zoltan Febert
Jr Varsity I
Forum|alt.badge.img+3

Hi @mjgrice32, which version of Acumatica are you using?


Forum|alt.badge.img
  • Author
  • Varsity I
  • May 30, 2024

 

Hi @mjgrice32, which version of Acumatica are you using?

 

For this customer, 2022 R2. We will be moving them to 2023 R2 sometime in the next two weeks.

 


Zoltan Febert
Jr Varsity I
Forum|alt.badge.img+3
  • Jr Varsity I
  • Answer
  • June 1, 2024

Hi @mjgrice32,

Please try this code below.

POCreate screen uses FixedDemand projection, SM_POCreate extension joins FSSODetFSSODetSplit projection to this projection. So we need to extend this second projection, and enable our new field in GetFixedDemandFieldScope.

I see only one problem here: PONbr doesn’t exist at this point, because we are going to create the Purchase Order now.

// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class SM_POCreateExt : PXGraphExtension<SM_POCreate, POCreate>
{
[PXOverride]
public virtual IEnumerable<Type> GetFixedDemandFieldScope(Func<IEnumerable<Type>> baseFunc)
{
foreach (var r in baseFunc())
{
yield return r;
}
// Add these fields to the Field Scope so they can be used in the
// Customization screen
yield return typeof(FSSODetFSSODetSplitExt.usrPONbr);
}
}

// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class FSSODetFSSODetSplitExt : PXCacheExtension<FSSODetFSSODetSplit>
{
#region UsrPONbr
public abstract class usrPONbr : PX.Data.BQL.BqlString.Field<usrPONbr> { }
[PXDBString(15, IsUnicode = true, InputMask = "", BqlField = typeof(FSSODetSplit.pONbr))]
[PXUIField(DisplayName = "PO Order Nbr.")]
public virtual string UsrPONbr { get; set; }
#endregion
}