Hi,
I'm trying to use vbs script to insert an entry into the AR_InvoiceHistory table using AR_InvoiceHistoryInquiry_bus object but I'm getting the following error:
Can anybody please help.
Hi,
I'm trying to use vbs script to insert an entry into the AR_InvoiceHistory table using AR_InvoiceHistoryInquiry_bus object but I'm getting the following error:
Can anybody please help.
Check the Primary Key of the table and you'll notice it has two fields: InvoiceNo and HeaderSeqNo. You can try to concatenate them together for a single SetKey line, but sometimes it's a bit of guessing…
Parag Vernekar it sounds like you are not using SetKeyValue()/SetKey() to put the record into an editable state prior to the Write(). Setkey() identifies the record you wish to edit or create and needs…
Nothing matters until you get the record into an editable state. Example from the scripting guide (which you'll have to adapt to your purpose):
retVal = oBusObj.SetKeyValue("ARDivisionNo$", sDiv)…
Parag Vernekar it sounds like you are not using SetKeyValue()/SetKey() to put the record into an editable state prior to the Write(). Setkey() identifies the record you wish to edit or create and needs to be done before setting any values or writing the record.
Hi. Thanks for replying.
I'm using nSetValue here to set value and still facing the same issue
Check the Primary Key of the table and you'll notice it has two fields: InvoiceNo and HeaderSeqNo. You can try to concatenate them together for a single SetKey line, but sometimes it's a bit of guessing to know how to null pad the key properly. SetKeyValue x2 plus the SetKey() is more reliable.
Thanks Kevin. But I'm still facing the same issue. I have added SetKeyValue method for HeaderSeqNo also.
Can you please crosscheck whether this will work?
Nothing matters until you get the record into an editable state. Example from the scripting guide (which you'll have to adapt to your purpose):
retVal = oBusObj.SetKeyValue("ARDivisionNo$", sDiv)
retVal = oBusObj.SetKeyValue("CustomerNo$", sCust)
retVal = oBusObj.SetKeyValue("ContactCode$", sContactCode)
'Now the do the SetKey() with no arguments:
retVal = oBusObj.SetKey()
'Now the row has been put into an Edit State
Nothing matters until you get the record into an editable state. Example from the scripting guide (which you'll have to adapt to your purpose):
retVal = oBusObj.SetKeyValue("ARDivisionNo$", sDiv)
retVal = oBusObj.SetKeyValue("CustomerNo$", sCust)
retVal = oBusObj.SetKeyValue("ContactCode$", sContactCode)
'Now the do the SetKey() with no arguments:
retVal = oBusObj.SetKey()
'Now the row has been put into an Edit State
Just a slight clarification on Kevin M's last comment in his example.
' If retVal<>0 then the row has been put into an Edit State
The example was a copy / paste from the scripting guide.
haha - well I'm sure the (cough) author had the error check somewhere after that snippit
*Community Hub is the new name for Sage City