cancel
Showing results for 
Search instead for 
Did you mean: 

PR Request with Approval using DI API--> Not go to Approval

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hai Pedro Magueija,

             Thankyou so much, it is working fine. your answer is correct.

Regards,

Sakthi

pedro_magueija
Active Contributor
0 Kudos

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;

- Is also inline with the ;

- Makes me happy;

Thanks.


Answers (1)

Answers (1)

pedro_magueija
Active Contributor
0 Kudos

Hi Sakthi,

You have to activate approvals for the DI. In the General Settings -> BP tab