I would like to add a virtual data field containing a custom db field UsrSubID in DB Table RQRequest.
I am trying to add the virtual field into a column in data grid on EPApproval screen. Below is my code on attend to use PXDBScalar to get the value for UsrSubID.
The relation between the two DAC is RQRequest.noteID = EPApproval.refNoteID
I get error:
error: The type name 'usrSubID' does not exist in the type
'PX.Objects.RQ.RQRequest' in file: Code#EPOwned(22)
Below is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PX.Data;
using PX.Objects.CM;
using PX.TM;
using PX.Objects.CR;
using PX.Objects;
using PX.Objects.EP;
namespace PX.Objects.EP{
public class EPApprovalExt: PXCacheExtension<PX.Objects.EP.EPApproval>{
#region UsrCustomField
[PXString]
[PXUIField(DisplayName="Sub Account")]
[PXDBScalar(typeof(Search<RQ.RQRequest.usrSubID,Where<RQ.RQRequest.noteID,Equal<Current<EP.EPApproval.refNoteID>>>>))]
public virtual string UsrCustomField{get;set;}
public abstract class usrCustomField : IBqlField{}
#endregion
}
}
I will delete this answer after I help Fillip because I can't comment in his questions.
Fillip if it doesn't exists in DAC you can not get it. So why not declare it in DAC?
If that is default DAC of Acumatica, you can use your package and choose Add Field in your package, or you can create you own.
I think key work Graph Extension can help you with this.
Remeber, your DAC must have UsrSubID Field before you use it to another DAC or Graph. See HB_Acumatica comment
Related
If I create a UserControl, to create and edit an instance of a data class e.g. Person in C# WindowsForms (call it PersonControl), the framework automatically adds an instance of Person in PersonControl.Designer with some default values for the properties and fills the item controls with those values. This behavior has a number of side effects which I would like to avoid.
Question: is there a defined way to prevent creation of a data class instance in UserControl.Designer?
I think you missing the DesignerSerializationVisibility attribute. If you have a custom control every public property that you add will automatically be serialized. You can use this attribute to disable the serialization for a property. I also recommend to add the Browsable attribute which will hide the property from the designer. If you want more control over serialization, like you want to serialize only when another property is set to true you can create a special named method which will then called by the designer Defining Default Values with the ShouldSerialize and Reset Methods. There was a MSDN Magazine where a lots of winform learning resource was relased there are some gems about winform internal working. If you interested in you can quickly look trhrough it. My favorite is. Create And Host Custom Designers With The .NET Framework 2.0
Sorry but i didn't mention another attribute DefaultValue You can use the attribute the following way.
public partial class PersonEditControl : UserControl
{
[DefaultValue(null)] // This attribute tells the designer if the property value matches what we specified in the attribute(null) it should not store the property value.
public PersonData? Person { get; set; }
public PersonEditControl()
{
InitializeComponent();
}
}
I am upgrading a customization project from 2019R1 to 2020R2. I have several custom tables/DACs that I reference within generic inquiries. In 2019R1, I'm able to select from these and it works fine without error.
In 2020R2, an obsolete table error is raised for existing customizations and I'm not able to select new custom DACs at all.
Is there an attribute or another way to suppress this error and allow visibility of new custom DACs so they can be used within generic inquiries?
Here is the code for my custom DAC:
namespace P1S
{
[System.SerializableAttribute()]
[PXCacheName("P1S Shipment Serial Nbrs.")]
public class PSSOShipSerialNbrs : PX.Data.IBqlTable
{
... column definitions ...
}
}
Unpublishing all customizations and then re-publishing from the main Customization Project screen (SM.20.45.05) fixes the error. Custom DACs are also now visible in the table selector.
I am Unable to Open Cash Sale Screen in Customization Editor of Acumatica, after I have added a new tab control with a Grid inside. I have assigned a custom DataView in the data member property of the Grid Control.
It Gives up the following error "The Customization Project Must Be Published before the screen can be edited. Error : The View CommissionCalcView does not exist".
Here "CommissionCalcView" is the name of my custom view, and it is Present in ARCashSaleEntry Extension of my project.
My Code Goes here....
using COMMISSIONMAPPING;
using PX.Objects.AR.Standalone;
namespace PX.Objects.AR
{
public class ARCashSaleEntry_Extension : PXGraphExtension<ARCashSaleEntry>
{
public PXSelect<CommissionCalculation,
Where<CommissionCalculation.cashSaleDocType,
Equal<ARCashSale.docType>,
And<CommissionCalculation.cashSaleRefNbr,
Equal<ARCashSale.refNbr>>>> CommissionCalcView;
#region Event Handlers
#endregion
}
}
Error Image
I have experienced this many times as well. The problem for me tends to be an error in how I define fields in a DAC extension or in improperly defining the view in the form.
In this case, you have BQL that is trying to compare CommissionCalculation (table selected in the BQL) to ARCashSale (table not selected in the BQL). Try adding Current<> on the ARCashSale references in the view so that it pulls the current value from the cache for ARCashSale in the base graph.
using COMMISSIONMAPPING;
using PX.Objects.AR.Standalone;
namespace PX.Objects.AR
{
public class ARCashSaleEntry_Extension : PXGraphExtension<ARCashSaleEntry>
{
public PXSelect<CommissionCalculation,
Where<CommissionCalculation.cashSaleDocType,
Equal<Current<ARCashSale.docType>>,
And<CommissionCalculation.cashSaleRefNbr,
Equal<Current<ARCashSale.refNbr>>>>> CommissionCalcView;
#region Event Handlers
#endregion
}
}
This was an issue with the development process and missing dlls, i removed the dll from the bin folder of my website and removed any key fields from my DAC, and rebuilt the project,
The problem was resolved
I have a custom table for historical data. It's a one-time data dump directly into SQL so I'd prefer not to have to create a screen for it.
I have three columns in my table:
CompanyID INT
InvoiceNbr NVARCHAR(40)
Amount DECIMAL(19,4)
I create a new Customization Project and added a new DAC to the Code area that is linked to my custom table:
https://i.imgur.com/6mNjdou.png (Screenshot #1)
https://i.imgur.com/IdNLJkR.png (Screenshot #2)
Then I create a Generic Inquiry, but I don't get the Paper Clip and Note icons. I was hoping to use the Paper Clip to upload documents and attach them to the records in my custom table.
So, I added another column to my custom table:
NoteID UNIQUEIDENTIFIER
And I re-added the new DAC which now generates this code:
https://i.imgur.com/QvpWB5X.png (Screenshot #3)
Now I get the Paper clip and Note icons in my Generic Inquiry:
https://i.imgur.com/olCglBB.png (Screenshot #4)
I can add a note or attach a document and the icons change color which makes it seem like the notes and documents got attached to the records. But when I refresh the page, everything goes away. Also, I can tell that nothing is getting stored in the database.
So the Paper Clip and Note icons don't work.
I'm wondering if it's possible to get the Paper Clip and Note icons to work in my Generic Inquiry without building a custom screen. Is this possible?
Tim, for Notes and Attachments to work properly, your NoteID field should be decorated with the PXNote attribute, instead of the default combination of PXDBGuid- and PXUIFieldAttribute. Will everything work as expected after you replace NoteID field declaration with the code snippet below and republish the customization?
public abstract class noteID : PX.Data.IBqlField
{
}
[PXNote()]
public virtual Guid? NoteID { get; set; }
I have an additional Libary project which has a custom button classs:
[MonoTouch.Foundation.Register("ItunesIphoneOpen")]
public class ItunesIphoneOpen: UIButton
When I set the class of a button in UIBuilder to ItunesIphoneOpen the partial code that is generated does not know about this class as it is in another namespace (and project)
Howe can I get the generated code to include a namespace reference to the namespace of ItunesIphoneOpen?
You're going to have to go into the *.designer.cs file and specify the namespace yourself. The standard MonoTouch.UIKit classes get handled automatically but I don't think the tool that generates the designer file will generate the namespace for custom UI classes.