Skip to Content
0
Jul 02, 2021 at 07:29 AM

Starting with .NET - Learning and Understanding Code

101 Views Last edit Jul 02, 2021 at 07:41 AM 2 rev

Hi,

I'm hoping to start to learn .net for SAP B1, but finding it really had to find any books which are SAP specific. I do have the SDK Help Center file and this is great for knowing all of the objects, classes and methods, but to be honest it's really difficult to take in without a guideline as to the best way to pick up this skill.

I'm using this code as a starting point, it already exists in my database, and i understand some of it.... The 2 things i am unsure about within the code; is

company.GetLastErrorDescription,5,true - I cannot find any reference to the ,5,true anywhere within the help files.

lRetCode = oBP.Update() - and i am trying to make sense of this? from what I understand .update is a method? and when it is pressed it returns a value, = would be true? 1 would be false possibly?

Any help would be great thank you!

Dim oBP As SAPbobsCOM.BusinessPartners
Dim StopCode As String = "$[$BOY_1.StopCode.0]"
Dim lRetCode As Integer
oBP = company.GetBusinessObject(BoObjectTypes.oBusinessPartners)
If oBP.GetByKey("$[$BOY_1.BPCode.0]") = True Then
oBP.UserFields.Fields.Item("U_StopCode").Value = StopCode
oBP.UserFields.Fields.Item("U_OnHold").Value = "Y"
lRetCode = oBP.Update()
If lRetCode <> 0 Then
application.SetStatusbarMessage("BP" + "$[$BOY_1.BPCode.0]" + "cannot be updated. Error: " + company.GetLastErrorDescription,5,true)
end if
End If