Is it possible to create records in AR_CustomerDocuments and AR_CustomerDocumentContacts via BOI?

SUGGESTED

Hi forum folks and Happy Friday!

I have a customer that would like to CC a specific inbox any time we send SO Invoices and orders via Paperless Office.  We have been doing this by adding this CC email to the "To Additional Email Addresses" Field under the Paperless button in Customer Maintenance.  The problem is that, when our customer adds a new customer, they sometimes forget to add these email addresses.  I figured we could create a script that would automatically add these values once they click Accept after adding a new customer.

Well, based on the documentation, I don't see a way of adding "SetValue" in any of the BUS or SVC files (e.g: AR_CustomerDocuments_Bus).  Is this possible?  

This is the script that I started with:

oDocument = 0
oEmail = 0
DivNo = 0
CustNo = ""
SODoc = "S/O Order"


retVal = oBusObj.GetValue("ARDivisionNo$",DivNo)
retVal = oBusObj.GetValue("CustomerNo$",CustNo)

if oBusObj.EditState = 2 then

set oDocument = oSession.AsObject(oSession.GetObject("AR_CustomerDocuments_svc"))

retVal = oDocument.SetKeyValue("ARDivision$", DivNo)
retVal = oDocument.SetKeyValue("CustomerNo$", CustNo)
retVal = oDocument.SetKeyValue("Document$", SODoc)
retVal = oDocument.SetKey()
retVal = oDocument.SetValue("PrintDocument$", "Y")
retVal = oDocument.SetValue("EmailDocument$", "Y")
retVal = oDocument.SetValue("UseEmailAddressInDataEntry$", "Y")

End if

  • 0
    SUGGESTED

    Service classes ( _SVC ) don't allow for creating new records or changing existing records.  You would want to use the business class ( _BUS ).

    The delivery option business classes are essentially line entry tasks similar to S/O Sales Order Entry or A/R Invoice Entry. 

    For your example you create an instance of AR_CustomerDocuments_bus, create the entry by setting A/R Division No, Customer No and  Document.  There is a property of Lines that is the object handle to the detail that you can use the AddLine() method to create the detail record that has the ToAdditionalEmailAddress$ value set.

    Note, create records using the Customer Maintenance, Paperless Delivery Options task and then use DFDM to see the valid values for the Document field.  When using the objects with BOI that has to be exactly the same, the validation will only accept specific values for Document.

  • 0 in reply to Steve Passmore

    Awesome, let me try that.  Thanks for the info I really appreciate all the help.