on 06-23-2016 11:13 AM
Dear Friend,
I have used the following code for make the Purchase Request using DI API,
Already We have set the Approval procedure for Each and Every Purchase Request. When we make the posting of Purchase Request at back end. it is not go for Purchase Request Approval.
we have to modify anything in code . please let me know.
oPurchaseRequest = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseRequest)
oPurchaseRequest.GetApprovalTemplates()
oPurchaseRequest .CardCode = CardCode
oPurchaseRequest Quatation.CardName = CardName
oPurchaseRequest .RequriedDate = Today.Date.ToString("dd/MM/yyyy")
oPurchaseRequest .DocDate = oGFun.getSingleValue("select getdate()")
oPurchaseRequest .VatDate = oGFun.getSingleValue("select getdate()")
oPurchaseRequest .TaxDate = oGFun.getSingleValue("select getdate()")
oPurchaseRequest .RequriedDate = oGFun.getSingleValue("select getdate()")
Dim count As Integer = oPurchaseRequest .Lines.Count
Dim firstLine As Integer = oPurchaseRequest .Lines.LineNum
For a = count - 1 To 1 Step -1
oPurchaseRequest .Lines.SetCurrentLine(a)
oPurchaseRequest .Lines.Delete()
Next
oPurchaseRequest .Lines.ItemCode = oDBDSDetail5.GetValue("U_ItemCode", i).ToString.Trim
oPurchaseRequest .Lines.RequiredDate = oGFun.getSingleValue("select getdate()")
oPurchaseRequest .Lines.Quantity = oDBDSDetail5.GetValue("U_CosQty", i)
oPurchaseRequest .Lines.ProjectCode = strprjcode
oPurchaseRequest .Lines.UserFields.Fields.Item("U_RowId").Value = oDBDSDetail5.GetValue("U_RowId", i).ToString.Trim
oPurchaseRequest .Lines.UserFields.Fields.Item("U_Type").Value = "PRQty"
oPurchaseRequest .Lines.UserFields.Fields.Item("U_TarTotal").Value = oDBDSDetail5.GetValue("U_TarTotal", i)
oPurchaseRequest .Lines.UserFields.Fields.Item("U_BOQDocNum").Value = frmBOQ.Items.Item("t_DocNum").Specific.value.ToString.Trim
oPurchaseRequest .Lines.UserFields.Fields.Item("U_BOQSeries").Value = frmBOQ.Items.Item("c_Series").Specific.value.ToString.Trim
oPurchaseRequest .Lines.Add()
lretcode = oPurchaseRequest .Add()
Regards,
Vijay
Hai Pedro Magueija,
Thankyou so much, it is working fine. your answer is correct.
Regards,
Sakthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sakthi,
I'm glad it's working.
Could I ask you to mark the real answer as correct?
- This helps others find the information easily;
- Makes me happy;
Thanks.
Hi Sakthi,
You have to activate approvals for the DI. In the General Settings -> BP tab
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
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.