How to add to a custom graph activities button? - acumatica

I created my own DAC and Graph following the framework guidelines, but I want to show Activities button on the right corner on the screen, how can I show this button? Is there an attribute? or an special field on the dac?

Your DAC needs a NoteID field, and then you can set ActivityIndicator = True on the primary view.
DAC
#region NoteID
[PXNote()]
public override Guid? NoteID { get; set; }
public new abstract class noteID : PX.Data.BQL.BqlGuid.Field<noteID> { }
#endregion
Customization Project - ActivityIndicator

Related

add field on vendor screen

when I add a new field, in the payment configuration tab.
It adds the field in location to the database, but at the same time I create DAC addressExt, I don't understand why.
here is the DAC of each one that created me.
First.
the field is created in this table: Location
namespace PX.Objects.CR.Standalone
{
public class LocationExt : PXCacheExtension<PX.Objects.CR.Standalone.Location>
{
#region UsrTest
[PXDBBool]
[PXUIField(DisplayName="test")]
public virtual bool? UsrTest { get; set; }
public abstract class usrTest : PX.Data.BQL.BqlBool.Field<usrTest> { }
#endregion
}
}
second.
namespace PX.Objects.CR
{
public class AddressExt : PXCacheExtension<PX.Objects.CR.Address>
{
#region UsrTest
[PXDBBool]
[PXUIField(DisplayName = "test")]
public virtual bool? UsrTest { get; set; }
public abstract class usrTest : PX.Data.BQL.BqlBool.Field<usrTest> { }
#endregion
}
}
view image:
I hope you understand, I'm not good at English.
This is actually being done by design. The DAC you are editing is a Projection consisting of multiple DACs. Check this link out from Sergey Marenich
PXProjection uses 2 Data Access Classes for quotes:
One class represents the table – PX.Objects.CR.Standalone.CRQuote.
Another represents view as combination of DACs in select – PX.Objects.CR.CRQuote.
And to correctly work, custom field needs to be added in both of the places. And Projection field should be linked to table field using BqlField property of DBFieldAttributes.

How to work with Extension Table with projection INKitAssembly projection class?

Below is extension DAC and Graph code, INRegisterKitAssemblyExt is a DAC, i have created a database table for that. i want to save usrSiteID value in INRegisterKitAssemblyExt(separate) database table. Please check how may i initialize extension DAC with INKitRegister DAC and save the value and how to use usrSiteId in UI?
[PXTable(typeof(INKitRegister.refNbr), typeof(INKitRegister.KitRevisionId))]
public class INRegisterKitAssemblyExt: PXCacheExtension<INKitRegister> {
#region RefNbr
public abstract class refNbr:PX.Data.BQL.BqlString.Field<refNbr> {
}
protected String _RefNbr;
[PXDBDefault(typeof(INKitRegister.refNbr))]
[PXDBString()]
[PXParent(typeof(Select<INKitRegister, Where<INKitRegister.refNbr, Equal<Current<refNbr>>,And<INKitRegister.kitRevisionID, Equal<Current<kitRevisionID>>>>>))]
public virtual String RefNbr {
get {
return this._RefNbr;
}
set {
this._RefNbr = value;
}
}
#endregion
#region KitRevisionID
public abstract class kitRevisionID:PX.Data.BQL.BqlString.Field<kitRevisionID> {
}
protected String _KitRevisionID;
[PXDBDefault(typeof(INKitRegister.kitRevisionID))]
[PXDBString()]
public virtual String KitRevisionID {
get {
return this._KitRevisionID;
}
set {
this._KitRevisionID = value;
}
}
#endregion
// My Fields as well as refNbr and KitRevison is also here
public virtual int? UsrQCSiteID {
get; set;
}
public abstract class usrQCSiteID:PX.Data.BQL.BqlInt.Field<usrQCSiteID> {
}
}
// Extension Graph
public class KitAssemblyEntryExt:PXGraphExtension<KitAssemblyEntry> {
}
INRegisterKitAssemblyExt in your code example is not a DAC.
DAC inherits from the IBqlTable base class.
INRegisterKitAssemblyExt in your code example is a DAC extension.
DAC extensions inherits from the PXCacheExtension base class.
You should never create database table for DAC extensions.
Custom fields in DAC extension will be persisted to the base DAC table automatically.
The main issue here is that INKitRegister is not DAC bound to a database table.
It's a Projection DAC and the INKitRegister database table does not exist.
The INKitRegister DAC projection points to the INRegister DAC:
[PXPrimaryGraph(typeof(KitAssemblyEntry))]
[PXCacheName(Messages.INKit)]
[PXProjection(typeof(Select2<INRegister, InnerJoin<INTran, On<INRegister.FK.KitTran>>>), Persistent=true)]
[Serializable]
public partial class INKitRegister : IBqlTable, ILSPrimary
You should create an extension on the INRegister DAC instead of INKitRegister because INRegister is bounded to an actual database table of the same name:
public class INRegisterKitAssemblyExt: PXCacheExtension<INRegister>

How can I get a prepopulated inventory field to show only the InventoryID and not the description (Acumatica)

We have a custom graph that was built for us by Acumatica; it uses a PXProjection called by the primary graph's PXSelectJoin to select data and populate the fields.
A couple of fields are inventory ID fields:
#region KitComponentID
public abstract class kitComponentID : IBqlField { }
[StockItem(DisplayName = "Kit Component ID", IsKey = true, BqlField = typeof(INKitSpecStkDet.compInventoryID))]
public virtual int? KitComponentID { get; set; }
#endregion
#region KitInventoryID
public abstract class kitInventoryID : IBqlField { }
[SOLineInventoryItem(DisplayName = "Kit ID", BqlField = typeof(SOLine.inventoryID))]
public virtual int? KitInventoryID { get; set; }
#endregion
These fields are not user editable, only for display. We would like to have them display only the InventoryCD, not the CD and description.
Is there a different way I can define my fields so that they are still automatically populated but display only the InventoryCD?
Under the screen editor, the field should have a drop-down of DisplayMode. By default, I believe it's Hint (which is Key + Description), Value (which is just key), and Text (which is Description.)
If you change the DisplayMode to Value, it should give you what you want.

Error updating SOLineSplit throws error: "'Related Document' may not be empty" when saving

I have made a UI (gridform) that let's the user view SOLineSplit, SOLine, SOOrder (all of these are acumatica DACs)- the objective is to be able to update/modify the allocation quantity (quantity) in SOLineSplit easily.
Namespace AllocationUpdate
{
public class AllocationUpdateEntry : PXGraph<AllocationUpdateEntry>
{
public PXSave<SOLineSplit> Save;
public PXCancel<SOLineSplit> Cance;
public PXSelectJoin<SOLineSplit,
RightJoin<SOLine,
On<SOLine.orderNbr, Equal<SOLineSplit.orderNbr>,
And<SOLine.inventoryID, Equal<SOLineSplit.inventoryID>,
And<SOLine.subItemID, Equal<SOLineSplit.subItemID>>>>,
RightJoin<SOOrder,
On<SOOrder.orderNbr, Equal<SOLine.orderNbr>>>>,
Where<SOLineSplit.isAllocated, Equal<True>>> Document;
but it throws error about OrderDate can't be empty. so i added the ff code in the BLC:
public class SOLineCacheExtension : PXCacheExtension<SOLineSplit>
{
#region OrderDate
public abstract class orderDate : IBqlField
{
}
[PXDBDate]
public DateTime? OrderDate { get; set; }
#endregion
but now it throws the "'Related Document' may not be empty" Error.
i tried modifying it like i did in OrderDate, but to no avail.
How can we solve this? Thank you.
FYI. Related Document of SOLineSplit is this field:
#region refnoteID
[PXRefNote]
[PXUIField(DisplayName = "Related Document", Enabled = false)]
public virtual Guid? RefNoteID { get; set; }
#endregion
Try to add the following PXSelect- s to your Graph so that attributes on SOLineSplit can work with the Cache of SOOrder and SOLine.
public PXSelect<SOOrder,Where<SOOrder.orderNbr,Equal<Current<SOLineSplit.orderNbr>>,
And<SOOrder.orderType,Equal<Current<SOLineSplit.orderType>>> CurrentOrder;
public PXSelect<SOLine,Where<SOLine.orderNbr,Equal<Current<SOLineSplit.orderNbr>>,
And<SOLine.orderType,Equal<Current<SOLineSplit.orderType>>,
And<SOLine.lineNbr,Equal<Current<SOLineSplit.lineNbr>>>> CurrentLine;
I ended up just Inserting another (with different Qty). I don't think it allows me to update it. But the behavior of the original uncustomized Acumatica seems to just perform Insert operation and thus, my answer.

Unbound field for an existing screen

I have a requirement for displaying allocated quantity in line items grid in Sales Order screen SO301000. As this is display only field, it should be unbound field. I know I can create unbound field for new screen by setting PrimaryView and TypeName properties. But not sure for an existing screen.
Declare respective CacheExtension. Include your unbound field declaration without PXDB datatypes. DB in the type attribute name denotes whether the field is bound.
#region UsrQtyAllocated
public abstract class usrQtyAllocated : IBqlField { }
protected Int32? _UsrQtyAllocated;
[PXUIField(DisplayName = "Qty. Allocated")]
public virtual Int32? UsrQtyAllocated { get; set; }
#endregion

Resources