on 09-29-2008 8:54 PM
Hi!
How can i update the expiration date of a BatchNumber by DI using C#?
thanks
Edited by: William Kurosu on Sep 29, 2008 10:45 PM
Edited by: William Kurosu on Sep 29, 2008 10:48 PM
You cannot update it, the only way is delete the line in document and creeate the line again with new batch and expiration date - in case that you are talking about batches in documents.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wonder how the UI does it?
I've been trying to figure out how to update and delete batches in C# as well, and so far am not finding it.
I've also tried to delete the line item, and re-create it with the new batch information. Though this isn't working either. It will insert the new line item, but the batches are not getting attached.
And yet, somehow the UI manages to do all of this. It does not appear to be deleting the line item, becuase the line item order remains the same when you look at them after a modification. The line item order would change if we deleted the line and then added it again. The new line item would move to the end of the list.
SAP, please HELP! Some clarity here would be MUCH APPRECIATED.
Thank you,
Mike and everyone who is experiencing these issues.
Thank you Yatsea.
Can you please share sample source code that we can use to add, update and delete batch line items from oOrder objects, in a way that would be agreeable with the SAP service contract?
We have been trying to figure this out for a REALLY long time, and it is becoming painful.
Also, is this same problem still present in SAP DIAPI 2007?
Is there a way to do it through the GUI API?
Your help is very appreciated.
Thanks,
Mike
Hello Michael,
See the sample below how to add oOrder with batch line items, but the you can't update the document with DI.
Dim oOrder As SAPbobsCOM.Documents = Nothing
oOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
oOrder.CardCode = "C001"
oOrder.DocDueDate = Date.Now
Dim oLines As SAPbobsCOM.Document_Lines = oOrder.Lines
'The Item should be managed by batch
'And Create the Batch number for the item when create Item
oLines.ItemCode = "B00001"
oLines.UnitPrice = 15
'Set the batch number for the line item here.
oLines.BatchNumbers.BatchNumber = "B001"
lRetCode = oOrder.Add
If 0 <> lRetCode Then
oCompany.GetLastError(lErrCode, errMsg)
MsgBox(errMsg)
Else
MsgBox("Sales order with batch number added.")
End If
UI: yes, you can simulate what you can do in B1 client with UI API
Item.Click()
EditText.String = "***"
...
I am afraid that it has the same the situation in 2007 SDK
Kind Regards
-Yatsea
User | Count |
---|---|
89 | |
7 | |
7 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.