0

I'd like to add the upload button to the Service Orders (FS300100) form, on the Inventory Items tab.

Following the advise here: Create additional "upload from file" button in header of Detail Grid Purchase Receipt in Acumatica, I got it the button to show. That said, I've clearly not got the right idea on the graph extension.

namespace PX.Objects.FS
{
  public class ServiceOrderEntry_Extension : PXGraphExtension<ServiceOrderEntry>
  {
    #region Event Handlers

    [PXViewName(Messages.FSSODetPart)]
    [PXImport(typeof(FSServiceOrder))]
      public PXSelect<FSSODetPart, Where<FSSODetPart.refNbr, Equal<Current<FSServiceOrder.refNbr>>,
      And<FSSODetPart.srvOrdType, Equal<FSServiceOrder.srvOrdType>>>> ServiceOrderDetParts;

    #endregion
  }
}

When I try to compile that I get these errors:

\App_RuntimeCode\ServiceOrderEntry.cs(34): error CS0104: 'Messages' is an ambiguous reference between 'PX.LicensePolicy.Messages' and 'PX.Objects.AP.Messages' \App_RuntimeCode\ServiceOrderEntry.cs(34): error CS0117: 'PX.LicensePolicy.Messages' does not contain a definition for 'FSSODetPart'

I'm guessing that I'm missing some understanding of how this is supposed to work. Thanks in advance.

T-Rav
  • 67
  • 9

1 Answers1

1

Set Grid's AllowUpload property to True and you need to override the data view, like so!

[PXViewName("Service Order Parts")]
    [PXImport(typeof(FSSODet))]
    public PXSelectJoin<FSSODetPart, LeftJoin<FSPostInfo, On<FSPostInfo.postID, Equal<FSSODetPart.postID>>>, Where<FSSODetPart.sOID, Equal<Current<FSServiceOrder.sOID>>>> ServiceOrderDetParts;
Vardan Vardanyan
  • 649
  • 5
  • 12
  • As always, stack**overflow** for the win! Thanks! – T-Rav Oct 04 '19 at 14:10
  • Original error is due to having Message class in many namespaces so the compiler doesn't know which one to use if you don't specify it explicitly. If target message was in Service Order namespace you could have fixed it with explicit inline namespace qualifier PX.Objects.FS.Messages.FSSODetPart. AllowUpload is the overarching solution which doesn't require the extension at all. – Hugues Beauséjour Oct 04 '19 at 14:40