You beat me to it Alnoor
""coItem"" and ""_obj"" are the variable names for the objects at the ProvideX level.
Typically, ""_obj"" is the same object handle as ""oBusObj"" in VBScript when you are running table or field event scripts. When the script is running on a UI event, it refers to the UI object, in this case, ""IM_ItemVendor_UI"".
""coBusiness"" is a local property of the UI object that points to the bus object associated with the UI object, in this case, ""IM_ItemVendor_Bus"". However, as Alnoor pointed out, it is better to get a new ""SVC"" handle to ""IM_ItemVendor"" instead because of the issue with the grid associated with the bus object. Although it worked in my testing on v2015, If Alnoor says there could be a problem, then I'm going to believe him.
The ""Evaluate"" and ""Execute"" methods of the ""oScript"" object allow you to run ProvideX code. ""Execute"" simply executes the command whereas ""Evaluate"" will return the result of the ProvideX command.
There are some properties and methods of objects that are ""Private"". These are only available to the object and can't be referenced in VBScript.
Since the item is already in edit mode in this session of item maintenance, I thought it best to avoid getting a new handle to ""CI_ItemCode_Bus"" and writing a value to it since it may result in your changes in item maintenance not being saved. In other words, if you open item maintenance twice, load the same item in each, make a change in one, accept it. then try to make a change in the other and accept it, you should get a message saying the record has been changed by another user and the changes will not be saved.
Because of that, it was necessary to the get object handle in memory that was pointing to the item code in item maintenance and the only way to do that I could think of was to use oScript.Evaluate since ""coItem"" is a local property of ""IM_ItemVendor_UI"".
I hope this makes sense.