SO_SalesOrderMemo_bus SetValue on field Attachment not work

we use a external BOI to maintain sales order memo, to validate attachment file path is valid, below script works for all other memo fields except Attachment. Does SetValue not work on field Attachment?

retChk(oSS.nSetDate("S/O", Today.ToString("yyyyMMdd")), oSS)
retChk(oSS.nSetModule("S/O"), oSS)
Dim obj1= oSS.nLookupTask("SO_SalesOrder_UI")
RetVal = oSS.nSetProgram(obj1)

'set up bus object
soORDER = oPVX.NewObject("SO_SalesOrderMemo_bus", oSS)

'set SalesOrderHeader key: SalesOrderNo
retChk(soORDER.nSetKeyValue("SalesOrderNo$", so_SalesOrderMemo.SalesOrderNo), soORDER)
retChk(soORDER.nSetKeyValue("MemoCode$", so_SalesOrderMemo.MemoCode), soORDER)
retChk(soORDER.nSetKeyValue("SeqNo$", so_SalesOrderMemo.SeqNo), soORDER)
retChk(soORDER.nSetKey(), soORDER)


retChk(soORDER.nSetValue("MemoDesc$", so_SalesOrderMemo.MemoDesc), soORDER)
retChk(soORDER.nSetValue("MemoDate$", so_SalesOrderMemo.MemoDate.ToString("yyyyMMdd")), soORDER)
retChk(soORDER.nSetValue("ExpirationDate$", so_SalesOrderMemo.ExpirationDate.ToString("yyyyMMdd")), soORDER)
retChk(soORDER.nSetValue("ReminderStartDate$", so_SalesOrderMemo.ReminderStartDate.ToString("yyyyMMdd")), soORDER)
retChk(soORDER.nSetValue("ReminderEndDate", so_SalesOrderMemo.ReminderEndDate.ToString("yyyyMMdd")), soORDER)
retChk(soORDER.nSetValue("AutoDisplaySetting$", so_SalesOrderMemo.AutoDisplaySetting), soORDER)
retChk(soORDER.nSetValue("Attachment$", so_SalesOrderMemo.Attachment), soORDER)
retChk(soORDER.nSetValue("MemoText$", so_SalesOrderMemo.MemoText), soORDER)

retChk(soORDER.nWrite(), soORDER)

Parents Reply Children
  • 0 in reply to BigLouie

    Thank you Big Louie, I did try attachment text using UNC, like C:\Shipping\Notice1.pdf, \\servername\shipping\Notice1.pdf, none of them work, it pop up this error message, if I do not update attachment, all other memo fields can be saved without issue, like memo desc, memo text, etc.

  • 0 in reply to John Pan

    if I use SO_SalesOrderHistoryMemo_bus, it works, I can add or update memo with attachment text in SO_SalesOrderHistoryMemo

    soORDER = oPVX.NewObject("SO_SalesOrderHistoryMemo_bus", oSS)

    I also test PO_PurchaseOrderMemo_bus and PO_PurchaseOrderHistoryMemo_bus, both can add or update memo with attachment text without error.

    only SO_SalesOrderMemo_bus not allow SetValue to attachment?