Skip to main content
Solved

Request to Add Import Button for Excel Upload in Documents To Apply Tab

  • November 4, 2024
  • 4 replies
  • 84 views

Forum|alt.badge.img

Hi All,

Is it possible to add an Import button that allows uploading an Excel sheet directly into the Documents To Apply tab on the Payments and Applications screen?

Thanks.

Best answer by aiwan

Hi @Lalith 

 

I believe you also have to invoke the IPXPrepareItems interface.

public virtual bool PrepareImportRow(string viewName, IDictionary keys, IDictionary values)
{
	if (string.Compare(viewName, "Products", true) == 0)
	{
		if (values.Contains("opportunityID"))
			values["opportunityID"] = Quote.Current.OpportunityID;
		else
			values.Add("opportunityID", Quote.Current.OpportunityID);
	}

	return true;
}

public bool RowImporting(string viewName, object row)
{
    return row == null;
}

public bool RowImported(string viewName, object row, object oldRow)
{
    return oldRow == null;
}

public virtual void PrepareItems(string viewName, IEnumerable items)
{
}

This is a snippet from the QuoteMaint graph.

 

Hope this helps,

Aleks

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

4 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hey @Lalith,

Yes, in the graph extension of ARPaymentEntry, rewrite the Adjustments view and decorate it with [PXImport] Attribute.

 

	public class ARPaymentEntry_Extension : PXGraphExtension<PX.Objects.AR.ARPaymentEntry>
	{
		#region Event Handlers
		[PXImport]
		[PXViewName(Messages.DocumentsToApply)]
		[PXCopyPasteHiddenView]
		public PXSelectJoin<ARAdjust,
	LeftJoin<ARInvoice, On<ARInvoice.docType, Equal<ARAdjust.adjdDocType>,
		And<ARInvoice.refNbr, Equal<ARAdjust.adjdRefNbr>>>,
	InnerJoin<Standalone.ARRegisterAlias,
		On<Standalone.ARRegisterAlias.docType, Equal<ARAdjust.adjdDocType>,
		And<Standalone.ARRegisterAlias.refNbr, Equal<ARAdjust.adjdRefNbr>>>,
	LeftJoin<ARTran, On<ARInvoice.paymentsByLinesAllowed, Equal<True>,
		And<ARTran.tranType, Equal<ARAdjust.adjdDocType>,
		And<ARTran.refNbr, Equal<ARAdjust.adjdRefNbr>,
		And<ARTran.lineNbr, Equal<ARAdjust.adjdLineNbr>>>>>>>>,
	Where<ARAdjust.adjgDocType, Equal<Current<ARPayment.docType>>,
		And<ARAdjust.adjgRefNbr, Equal<Current<ARPayment.refNbr>>,
		And<ARAdjust.released, NotEqual<True>>>>> Adjustments;
		#endregion
	}

Also, set grid property AllowUpdate to true.

Feel free to post back if you have any questions.! Good Luck,


Forum|alt.badge.img
  • Author
  • Freshman I
  • 22 replies
  • November 6, 2024

Hi @Vignesh Ponnusamy,

Thank you for your response.

Yes, in my local instance, it’s functioning as expected, as shown below. However, on the client side, the rows did not update according to the Excel file. Although the message “The operation has completed” appears (as shown in the image below), the rows remain unchanged.


Any Idea, please?


Nilkanth Dipak
Semi-Pro I
Forum|alt.badge.img+10

Hi @Lalith,

I found This post that may address the issue you're facing. Check the comment by @darylbowman for further insights.

It appears there are different features enabled between the instances. Interestingly, the demo instance (where it’s working) has more features turned on, which could typically make it more complex and potentially less reliable.

Hope it helps!


Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • Answer
  • November 6, 2024

Hi @Lalith 

 

I believe you also have to invoke the IPXPrepareItems interface.

public virtual bool PrepareImportRow(string viewName, IDictionary keys, IDictionary values)
{
	if (string.Compare(viewName, "Products", true) == 0)
	{
		if (values.Contains("opportunityID"))
			values["opportunityID"] = Quote.Current.OpportunityID;
		else
			values.Add("opportunityID", Quote.Current.OpportunityID);
	}

	return true;
}

public bool RowImporting(string viewName, object row)
{
    return row == null;
}

public bool RowImported(string viewName, object row, object oldRow)
{
    return oldRow == null;
}

public virtual void PrepareItems(string viewName, IEnumerable items)
{
}

This is a snippet from the QuoteMaint graph.

 

Hope this helps,

Aleks


Reply


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