3

Is there a way to get the grid control that allows one to upload data from an Excel sheet? I haven't found a command that will put this control on the toolbar.

pmfith
  • 831
  • 6
  • 24

1 Answers1

5

You need to decorate data view with PXImportAttribute.

Example:

[PXViewName(Messages.SOLine)]
[PXImport(typeof(SOOrder))]
[PXCopyPasteHiddenFields(typeof(SOLine.completed))]
public PXSelect<SOLine, Where<SOLine.orderType, Equal<Current<SOOrder.orderType>>, 
             And<SOLine.orderNbr, Equal<Current<SOOrder.orderNbr>>>>,OrderBy<Asc<SOLine.orderType, Asc<SOLine.orderNbr, Asc<SOLine.lineNbr>>>>> Transactions;

PXImport attribute enables the user to load data from the file to the grid. The attribute is placed on the data view the grid uses to retrieve the data.

We have used PXImportAttribute(Type) constructor where input parameter is the first (Primary) DAC that is referenced by the primary view of the graph where the current view is declared.

Set Grid's AllowUpload property to True.

enter image description here

AllowUpload property controls the display of the Load Records from file toolbar button.

DChhapgar
  • 2,280
  • 12
  • 18
  • Thanks - do I just create a graph extension and re-declare the grid's view exactly as it is in the source code? – pmfith Sep 22 '16 at 19:34
  • @pmfith yes. Create a graph extension and re-declare the grid's view exactly as it is in the source code with PXImport attribute. – DChhapgar Sep 22 '16 at 21:30