I have a custom mater-detail screen and all standard action buttons including Copy & Paste. When I try to copy and paste an existing dataset to a new form, I get an error. I was wondering does Acumatica’s engine itself handles the copy and paste operations or I should write a custom code for it?
Hi,
Can you please let us know what error you are getting while doing this activity?
Hi
This is my custom form
When I copy and enter the Doc PKs and try to paste I get this error
Hi
Thank you
public class UDCTPMCashflowProjectionEntry : PXGraph<UDCTPMCashflowProjectionEntry, UDCTPMCashflowProjection>
{
PXViewName("Project Cashflow Projections")]
public PXSelect<UDCTPMCashflowProjection> CashflowProjections;
public PXSelect<UDCTPMCashflowProjection,
Where<UDCTPMCashflowProjection.projectID, Equal<Current<UDCTPMCashflowProjection.projectID>>>> RevisionsFilter;
public PXSelect<UDCTPMCashflowProjectionSchedule,
Where<UDCTPMCashflowProjectionSchedule.projectID, Equal<Current<UDCTPMCashflowProjection.projectID>>,
And<UDCTPMCashflowProjectionSchedule.revisionID, Equal<Current<UDCTPMCashflowProjection.revisionID>>>>> CashflowProjectionSchedules;
public PXSelect<PMProject,
Where<PMProject.contractID, Equal<Current<UDCTPMCashflowProjection.projectID>>>> ProjectsFilter;
}
UPDATE
I figured out what causes the issue. It is not the graph. it is a property of one of the DAC fields that I have commented in the below code.
#region TranPeriodID
public abstract class tranPeriodID : PX.Data.BQL.BqlString.Field<tranPeriodID> { }
protected String _TranPeriodID;
PeriodID(IsKey = true)]
///CrossReferenceUniqueness(
// typeof(UDCTPMCashflowProjectionSchedule.tranPeriodID),
// ClearOnDuplicate = false,
// IgnoreDuplicatesOnCopyPaste = false,
// IgnoreNulls = true,
// UniqueKeyIsPartOfPrimaryKey = true,
// Where = typeof(Where2<Where<UDCTPMCashflowProjectionSchedule.projectID, Equal<Current<UDCTPMCashflowProjection.projectID>>>,
// And<UDCTPMCashflowProjectionSchedule.revisionID, Equal<Current<UDCTPMCashflowProjection.revisionID>>>>),
// ErrorMessage = "Month {0} already exist!")]
PXParent(typeof(Select<UDCTPMCashflowProjection, Where<UDCTPMCashflowProjection.projectID, Equal<Current<UDCTPMCashflowProjectionSchedule.projectID>>,
And<UDCTPMCashflowProjection.revisionID, Equal<Current<UDCTPMCashflowProjectionSchedule.revisionID>>>>>))]
PXUIField(DisplayName = "Month", Visibility = PXUIVisibility.SelectorVisible, Required = true, Enabled = false, Visible = true)]
public virtual String TranPeriodID { get; set; }
#endregion
Now I have to problems.
- How can check this field uniqueness in combination with ProjectID and RevisioID?
- Copy/Paste only pastes the header but doesnt do the detils. Any thought why?
Hi
Hi
Hi
Thank you for the updates
Hi,
Can you please let us know what error you are getting while doing this activity?
My apology to
- Base: is your Base Graph
- target: is the new instance of the Base Graph
- MyView: is your Public View for the record(s)
- row: is the current record you want to copy
- rowCopy: is the copy of the current record
using PX.Data;
// Stuff here
// Below two lines will copy the Attachments
Guida] files = PXNoteAttribute.GetFileNotes(Base.MyView.Cache, row);
PXNoteAttribute.SetFileNotes(target.MyView.Cache, rowCopy, files);
// Below two lines will copy the Notes
string note = PXNoteAttribute.GetNote(Base.MyView.Cache, row);
PXNoteAttribute.SetNote(target.MyView.Cache, rowCopy, note);
// Stuff here
Hi,
Thank you for all your support pal.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.