Getting Error : Invalid Column NoteId - acumatica

I have requirement to add Image for each serial number.
I have extended the INItemLotSerial and added ImageUrl & NoteID field
[PXTable(typeof(INItemLotSerial.inventoryID),
typeof(INItemLotSerial.lotSerialNbr),
IsOptional = true)]
public class InfoINItemLotSerialExtNV : PXCacheExtension<INItemLotSerial>
The DAC Having the following code for NoteID
#region NoteID
public abstract class noteID : PX.Data.IBqlField
{
}
protected Guid? _NoteID;
[PXNote]
public virtual Guid? NoteID
{
get
{
return this._NoteID;
}
set
{
this._NoteID = value;
}
}
#endregion
while saving the Purchase receipt document after entering serial numbers, I am getting error Invalid Column : NoteID
`

Currently, PXNoteAttribute do not support extension tables, so your only option is use a regular extension for the INItemLotSerial DAC over an extension table.

Related

Add Field NoteID for Rest API

In acumatica, the ID Row is an entity persistent for REST API only for table with the Field NoteID.
It's possible to add NoteID for dac without this field.
Do you think it's the best way ? (example for the POVendorInventory)
In SQL Script
IF NOT EXISTS(SELECT 1 FROM sys.columns
WHERE Name = N'NoteID'
AND Object_ID = Object_ID(N'POVendorInventory'))
BEGIN
ALTER TABLE POVendorInventory ADD NoteID uniqueidentifier
END
In the description
#region NoteID
public abstract class noteID : PX.Data.IBqlField { }
protected Guid? _NoteID;
[PXNote()]
public virtual Guid? NoteID { get; set; }
#endregion

how to add a field on the Project Quotes screen PQ000025

Good morning, I want to add a new field on this screen Project Quotes but in doing so I get this message, that the table does not exist.
How should or what is the way to achieve it.
Thanks in advance
Imagen 01
The added field in the database
enter image description here
He added the field in the database and then I generated my extension.
namespace PX.Objects.CR
{
public class PMQuoteExt : PXCacheExtension<PX.Objects.CR.CRQuote>
{
#region UsrNota
[PXDBString(-1, InputMask = "", BqlField = typeof(PMQuoteStandaloneExt.usrNotaText))]
[PXUIField(DisplayName = "Nota ")]
public virtual string UsrNotaText { get; set; }
public abstract class usrNotaText : IBqlField { }
#endregion
}
public class PMQuoteStandaloneExt : PXCacheExtension<PX.Objects.CR.Standalone.CRQuote>
{
#region UsrNota
[PXDBString(-1, InputMask = "")]
[PXUIField(DisplayName = "Nota ")]
public virtual string UsrNotaText { get; set; }
public abstract class usrNotaText : IBqlField { }
#endregion
}
}
public class PMQuoteMaint_Extension : PXGraphExtension<PMQuoteMaint>
{
public PXSelect<PX.Objects.CR.Standalone.CRQuote> Test;
}
However, when I record, it does not fill the field.
that I am making a mistake or doing wrong.
Can you tell me please.
Thank you
PMQuote is not an actual DB table, but a BQL projection between tables:
CR.Standalone.CRQuote
CROpportunityRevision
CR.Standalone.CROpportunity
The way that I would tackle this is:
Add the field in table CRQuote
Extend the graph and override the Projection with the inclusion of the new CRQuote field.
UPDATE:
Based on #HB_Acumatica suggestion, step 2 would get simplified to a DAC extension (no need for the Graph extension). Much simpler to maintain in subsequent Acumatica versions!
UPDATE 2:
The extended DACs do not look correct in your question. Keep in mind that you should extend the original table (CRQuote), and the projection in order to have the value persisted.
The following definition worked correctly on my end:
//Projection extension
public class PMQuoteExt : PXCacheExtension<PMQuote>
{
#region UsrCustomField
[PXDBString(100, BqlField = typeof(CRQuoteExt.usrCustomField))]
[PXUIField(DisplayName="Custom Field")]
public virtual string UsrCustomField { get; set; }
public abstract class usrCustomField : IBqlField { }
#endregion
}
//Actual Table extension
public class CRQuoteExt : PXCacheExtension<PX.Objects.CR.Standalone.CRQuote>
{
#region UsrCustomField
[PXDBString(100)]
[PXUIField(DisplayName="Custom Field")]
public virtual string UsrCustomField { get; set; }
public abstract class usrCustomField : IBqlField { }
#endregion
}

How can I get a wildcard appended to a substring of a DAC field?

The screen I'm customizing is the 'Requests' screen (RQ301000) - and I want to modify the Vendor lookup in the grid to be based on the Request class chosen in the header. I already know how to modify the Vendor selector to include a filter, as I have done this on the Requisitions screen - but that customization included adding a user field for Request Class (which doesn't exist on the Requisitions screen).
I do have code that I obtained previously that gets a wildcard appended value of a field. The problem is, this code used a User field that was in the same DAC as the wildcard field - The code is shown below:
public class RQRequisitionExt : PXCacheExtension<RQRequisition>
{
#region UsrRequestClass
[PXDBString(10, IsUnicode = true)]
[PXUIField(DisplayName = "NSA Request Class", Visibility = PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(RQRequestClass.reqClassID), DescriptionField = typeof(RQRequestClass.descr))]
public virtual string UsrRequestClass { get; set; }
public abstract class usrRequestClass : IBqlField {}
#endregion
//This is a DAC field that creates / tacks on a wildcard to the end of the UsrRequestClass field above...
public abstract class myFieldWildcard : IBqlField { };
[PXString(30, IsUnicode = true)]
public virtual string MyFieldWildcard
{
[PXDependsOnFields(typeof(usrRequestClass))]
get
{
//return PXDatabase.Provider.SqlDialect.WildcardAnything + UsrRequestClass + PXDatabase.Provider.SqlDialect.WildcardAnything;
if (UsrRequestClass != null)
return PXDatabase.Provider.SqlDialect.WildcardAnything + UsrRequestClass.Substring(0, 2) + PXDatabase.Provider.SqlDialect.WildcardAnything;
else
return UsrRequestClass;
}
}
}
For what I'm trying to do on the Requests screen, I'm not using a user field for this - I'm using the Request Class field already on the screen - but I have no idea how to get the value of this field to use in the wildcard 'get' routine.
Essentially, I want to obtain the Request Class value on the screen and use it in this wildcard field to return to my modified Vendor selector (not shown - but done using a CacheAttached event).
Any help would be appreciated. Thanks.
The solution, for me, was to redefine the Request Class field in the same DAC extension that contained the wildcard field, as follows:
public class RQRequestExt : PXCacheExtension<RQRequest>
{
//Redefine the Request Class in this DAC extension
#region ReqClassID
public abstract class reqClassID : IBqlField {}
[PXDBString(10, IsUnicode = true)]
[PXDefault(typeof(RQSetup.defaultReqClassID))]
[PXUIField(DisplayName = "Request Class", Visibility = PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(RQRequestClass.reqClassID), DescriptionField = typeof(RQRequestClass.descr))]
public virtual string ReqClassID { get; set; }
#endregion
//This is a DAC field that creates / tacks on a wildcard to the end of the UsrRequestClass field above...
public abstract class rQRequestwildcard : IBqlField { };
[PXString(30, IsUnicode = true)]
public virtual string RQRequestwildcard
{
[PXDependsOnFields(typeof(RQRequest.reqClassID))]
get
{
if (ReqClassID != null)
return PXDatabase.Provider.SqlDialect.WildcardAnything + ReqClassID.Substring(0, 2) + PXDatabase.Provider.SqlDialect.WildcardAnything;
else
return PXDatabase.Provider.SqlDialect.WildcardAnything;
}
}
}
This way I have a reference to the Request Class ID used in the Wildcard field operation...

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.

Search in GI Gives error while using Sector field

I have created a Name value pair field for Sales Order table and Search is giving error while using the field from Description field in selector
#region UsrLoader
public abstract class usrLoader : IBqlField { }
[PXDBString(128, IsUnicode = true)]
[PXUIField(DisplayName = "Operator 1")]
[PXSelector(typeof(EPEmployee.acctCD),
new Type[]
{
typeof(EPEmployee.acctCD),
typeof(EPEmployee.acctName)
},
DescriptionField = typeof(EPEmployee.acctName))]
public virtual string UsrLoader { get; set; }
#endregion
#region UsrUnLoader
[PXDBString(128)]
[PXUIField(DisplayName = "Operator 2")]
[PXSelector(typeof(EPEmployee.acctCD),
new Type[]
{
typeof(EPEmployee.acctCD),
typeof(EPEmployee.acctName)
},
DescriptionField = typeof(EPEmployee.acctName))]
public virtual string UsrUnLoader { get; set; }
public abstract class usrUnLoader : IBqlField { }
#endregion
I am getting the following error
Typically I see the Invalid column error when the customization hasn't been published to insert the field in the database table. Did you publish after adding the fields?
Also, the warnings might tell you to join in the parent table. Did you try doing a join to the EPEmployee table to use the description/name field in your GI?

Resources