Create a Customer Equipment card using easy row function
SBOMAster
Hello
I created a new rule on the BP Master data form that creates a customer equipment rule by using this code:
' This function has been delivered by coresystems ag as a sample. This sample has been tested with a SAP Business One demo database and is delivered without further warranties.
' ***** Description: *****
' Opens a service call and fills the cardcode from the business partner form to the new form.
' ***** Parameters: *****
' This function does not contain any parameters.
' ***** Function source code: *****
Try
Dim cardType As String = ComboBox.GetFromUID(pVal.Form, "40").Value 'Get cardtype from current form
If cardType <> "C" Then
MessageBox.Show("Only valid for business partners of type customer.", "OK")
Return
End If
Dim cardCode As String = TextEdit.GetFromUID(pVal.Form, "5").Value 'get cardcode from current form
MenuItem.GetFromUID("3591").Activate() 'activate new object by menu item
MenuItem.GetFromUID("1282").Activate() 'activate new object by menu item
Dim form As Form = Form.GetFormFromUID(customize.B1Connector.GetB1Connector().Application.Forms.ActiveForm.UniqueID) 'get new form
TextEdit.GetFromUID(form, "48").Value = cardCode 'set cardcode to new form
Catch ex As Exception
customize.Messaging.StatusBar.WriteError("Error Creating Customer Equipment Card : Open new Service Call): " & ex.ToString())
customize.Messaging.Debug.WriteMessage("Error in coresuite customize Rule (BUP:0006: Open new Service Call): " & ex.ToString(), customize.Messaging.Debug.DebugLevel.Exception)
End Try
Works OK.
I would like to run the same funcionallity when creating an invoice:
I added a UDF SerialNumber in the documents line. I want to run the code that works from the BP Master data form when adding th invoice:
If the user writes a value in the SerialNumber UDF then the rule will create a new customer equipmet card using the ItemCode and the SerialNumber.
to start with I want only one card to be created.
When coping the code to the the function area I get syntax error before changing anything.
I attached screenShots
What am I doing wrong? Where do I have to write the code?
I would be very greatfuul for help
Rubin
Please sign in to leave a comment.
Comments
0 comments