Skip to main content
Solved

Import Scenario to delete time activities

  • September 23, 2024
  • 2 replies
  • 73 views

Hi All,

I am attempting to create an import scenario that allows the deletion of time activities. The time activities in my file have the complete status, none in the list are released. Looking at the DAC Note ID is the key field. The records that need to be deleted are across a few months. I keep getting the following error:

 

 

I know I am missing something in order of operation or an additional field that needs to be part of the query but have been at it for a bit now and thought I’d see if anyone on here had experienced it or had been successful in doing so before. Please see screenshot below of current import map.

 

 

Best answer by hdussa

Hello @BDanhardt70 ,

This is by the design. Acumatica native code stopping it to delete the Released records. Try with a simple customization to unblock the “Released” records in the RowDeleting event with IsImport flag. This way you can bypass the condition for the Import Scenario.

 

protected virtual void EPActivityApprove_RowDeleting(PXCache sender, PXRowDeletingEventArgs e, PXRowDeleting baseEvent)
{
    baseEvent?.Invoke(sender, e);
	EPActivityApprove row = (EPActivityApprove)e.Row;
	if (row == null)
		return;

	if (row.Released == true && !IsImport)
	{
		Filter.View.Ask(Messages.ActivityIsReleased, MessageButtons.OK);
		e.Cancel = true;
	}	
}

Hope this helps!

View original
Did this topic help you find an answer to your question?

2 replies

hdussa
Jr Varsity I
Forum|alt.badge.img
  • Jr Varsity I
  • 99 replies
  • Answer
  • September 24, 2024

Hello @BDanhardt70 ,

This is by the design. Acumatica native code stopping it to delete the Released records. Try with a simple customization to unblock the “Released” records in the RowDeleting event with IsImport flag. This way you can bypass the condition for the Import Scenario.

 

protected virtual void EPActivityApprove_RowDeleting(PXCache sender, PXRowDeletingEventArgs e, PXRowDeleting baseEvent)
{
    baseEvent?.Invoke(sender, e);
	EPActivityApprove row = (EPActivityApprove)e.Row;
	if (row == null)
		return;

	if (row.Released == true && !IsImport)
	{
		Filter.View.Ask(Messages.ActivityIsReleased, MessageButtons.OK);
		e.Cancel = true;
	}	
}

Hope this helps!


  • Author
  • Freshman I
  • 8 replies
  • September 26, 2024

@hdussa  thanks for the reply! Will give this a shot and let you know how it goes!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings