Scripting

  • 1.  Help please! :) I have a customer that's requeste

    Posted 09-30-2015 08:31
    Help please! :) I have a customer that's requested a script to change an email address in the Cust Maint Paperless Office Delivery Options on the change of the Sales Person. The script seems to run correctly & the debug print after write looks like it updated the value, but it's not actually doing it. Any suggestions? WHAT AM I DOING WRONG! haha Here's my test script: sNewEmail="""" 'Get connection to AR_CustomerDocumentContacts oPLobj = oSession.GetObject(""AR_CustomerDocumentContacts_bus"") Set oPLobj = oSession.AsObject(oPLobj) retVal = oPLObj.SetValue(""ARDivisionNo$"", ""01"") retVal = oPLObj.SetValue(""CustomerNo$"", ""ABF"") retVal = oPLobj.SetValue(""Document$"", ""S/O INVOICE"") retVal = oPLobj.SetKey() retVal = oPLObj.SetValue(""ToAdditionalEmailAddress$"", ""testing@test.com"") retVal = oPLobj.Write() retVal = oPLObj.GetValue(""ToAdditionalEmailAddress$"", sNewEmail) dbg=oscript.debugprint(""New Email: "" & sNewEmail)


  • 2.  RE: Help please! :) I have a customer that's requeste

    Posted 09-30-2015 09:22
    Shouldn't those first three SetValues actually be SetKeyValue?


  • 3.  RE: Help please! :) I have a customer that's requeste

    Posted 09-30-2015 09:45
    I believe you're correct, but when changed, it doesn't change anything. It still isn't updating the field value. :(


  • 4.  RE: Help please! :) I have a customer that's requeste

    Posted 09-30-2015 09:50
    The Primary key also requires the LineKey field, so you may want to iterate through the records to find those that match first.


  • 5.  RE: Help please! :) I have a customer that's requeste

    Posted 09-30-2015 11:46
    I tried both line key & line seq key & neither helped. It seems like I'm missing a step/table that needs to be worked through first. :(


  • 6.  RE: Help please! :) I have a customer that's requeste

    Posted 09-30-2015 12:47
    Have you checked your retvals to see if you are getting any errors?


  • 7.  RE: Help please! :) I have a customer that's requeste

    Posted 09-30-2015 12:48
    I'm seeing the same behavior in 2014, so I guess misery loves company. The SetKey is clean, the SetValue returns a 1, and a GetValue actually grabs the correct email, but it never hits disk.


  • 8.  RE: Help please! :) I have a customer that's requeste

    Posted 09-30-2015 12:58
    I'm sad & glad at the same time that you're seeing the same behavior Steve. I have been banging my head over this & can't see any reason why it's not hitting the table. Thank you so much for looking at it & testing on your end, I really appreciate the 2nd pair of eyes!