Create UDO object through DI API

Hi folks,
I want to create an UDO object directly from the code. Deep inside, I have an UDO that wraps an authorization document.
How can I create an object from my AddOn and add it in SAP BO.
Thanks in advance!
Oscar S.M.

example is for master data and masterdata lines UDO. For other types is almost same.
Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD
        oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
        oUserObjectMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tNO
        oUserObjectMD.CanClose = SAPbobsCOM.BoYesNoEnum.tNO
        oUserObjectMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tNO
        oUserObjectMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tNO
        oUserObjectMD.CanFind = SAPbobsCOM.BoYesNoEnum.tNO
        oUserObjectMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tYES
        oUserObjectMD.ChildTables.TableName = "LINES"
        oUserObjectMD.Code = "DATA"
        oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tNO
        oUserObjectMD.Name = "Data"
        oUserObjectMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData
        oUserObjectMD.TableName = "DATA"
        lRetCode = oUserObjectMD.Add()
        If lRetCode <> 0 Then
            oCompany.GetLastError(lRetCode, sErrMsg)
            MsgBox(sErrMsg)
        End If
        oUserObjectMD = Nothing
        GC.Collect()

Similar Messages

  • Can Not Create Serviceable Item Through DI API

    Hi Experts,
    My Client is using SAP 8.81 PL0 ,I am creating Serviceable Item through DI API, using following code
    oItems = (SAPbobsCOM.Items)SBOAddOn.SBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems);
    oItems.ItemClass = SAPbobsCOM.ItemClassEnum.itcService
    When I am going to Add it throw the msg ,ServiceCat is blank
    In DI object I am not able to find the service category kindly help me out.
    Thanks
    Edited by: Anup Kharwar on Feb 21, 2012 5:40 AM

    Hi,
    The SDK helpfile has this to say about the itemClass property:
    SDK helpfile:
    Remarks
    The ItemClass property is applicable for cluster B (country-specific for Brazil only).
    For example in the Finnish localization we do not have a field in the Item Master Data window for ItemClass. We do have the field ItemType
    Does your localization have a field for itemClass anywhere in the B1 client ?
    Regards,
    Johan

  • Privileges for creating DB objects through portal

    All,
    I am a portal administrator and want to give portal access to a developer to create their own portal page against their own db schema. They would like to create db objects through the portal interface (i.e. tables).
    My question:
    What privileges/grants/roles do I need to give them to create db objects? Do I need to give them the DBA role? Do they need "Full Administrator" privileges within portal?
    Thanks,
    Jon.

    Sorry, your question is not very clear. From what I got:
    You want the privilege to be able to create DB Objects. For that:
    you just need an End-User with "Manage" privilege on any of the "Schema".

  • Problem in Creating Default Form Through DI API

    Hi All,
    I am using the below code to create UDO and make it as Default Form through DI API. But the Default Form property is not getting set, that is the Default Form is not being created. The UDO is getting created. Any help is appreciated.
    // Verify that UDO is defined
                if (!(oCreateUDO.UDOExist(oCompany, "WEB_USER")))
                    SAPbobsCOM.UserObjectsMD MyUDO = (SAPbobsCOM.UserObjectsMD)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD);
                    //Set Services
                    MyUDO.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES;
                    MyUDO.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tYES;
                    MyUDO.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES;
                    MyUDO.CanFind = SAPbobsCOM.BoYesNoEnum.tYES;
                    MyUDO.CanClose = SAPbobsCOM.BoYesNoEnum.tYES;
                    MyUDO.CanLog = SAPbobsCOM.BoYesNoEnum.tYES;
                    MyUDO.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tNO;
                    //MyUDO.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES;
                    MyUDO.Code = "WEB_USER";
                    MyUDO.Name = "Define Portal User";
                    MyUDO.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData;
                    MyUDO.TableName = "PORUSR";
                    MyUDO.FindColumns.ColumnAlias = "Code";
                    MyUDO.FindColumns.ColumnDescription = "Code";
                    MyUDO.FindColumns.Add();
                    MyUDO.FindColumns.ColumnAlias = "Name";
                    MyUDO.FindColumns.ColumnDescription = "Name";
                    MyUDO.FindColumns.Add();
                    MyUDO.FindColumns.ColumnAlias = "U_name";
                    MyUDO.FindColumns.ColumnDescription = "Name";
                    MyUDO.FindColumns.Add();
                    MyUDO.FindColumns.ColumnAlias = "U_Email";
                    MyUDO.FindColumns.ColumnDescription = "Email";
                    MyUDO.FindColumns.Add();
                    MyUDO.FindColumns.ColumnAlias = "U_Status";
                    MyUDO.FindColumns.ColumnDescription = "Status";
                    MyUDO.FindColumns.Add();
                    MyUDO.FindColumns.ColumnAlias = "U_TAG";
                    MyUDO.FindColumns.ColumnDescription = "TAG";
                    MyUDO.FindColumns.Add();
                    MyUDO.FindColumns.ColumnAlias = "U_bp";
                    MyUDO.FindColumns.ColumnDescription = "BP Code";
                    MyUDO.FindColumns.Add();
                    MyUDO.FindColumns.ColumnAlias = "U_password";
                    MyUDO.FindColumns.ColumnDescription = "Password";
                    MyUDO.FindColumns.Add();
                    if (MyUDO.Add() != 0)
                        MessageBox.Show("Failed to add UDO");
    Thanks and Regards,
    Noor Hussain

    Dear All,
    Thanks a lot. I had forgot to add the form columns to the UDO object while creating UDO.
    Regards,
    Noor Hussain
    Edited by: noor_023 on Mar 1, 2012 11:54 AM

  • Create SE61 objects through programs.

    Hi,
    Is there any way to create an SE61 object (Dailog Text) through a program. I have more than 100 objects to be created. Is there any possibilty that I can upload my documentation through a file and create SE61 object for the same?
    Please help me in this regard.
    Regards,
    Kishore.

    Hi
    I recommend you use the API JAXB. Is much simpler.
    here a link: http://www.oracle.com/technetwork/articles/javase/index-140168.html
    here a example: http://download.oracle.com/javaee/5/tutorial/doc/bnbay.html#bnbbc

  • Problem In Creating Sales Order Through DI API

    Hi
    I am Creating The Sales Order Through DI API.
    the Error Is Coming - " [OACT] , 'No matching records found (ODBC -2028)'"
    anyone  can help me solving it.

    Hi vivek,
    Have you tried adding the same document with the client ?
    OACT is the accounts table and this error message typically indicates that there is an account parameter missing somewhere in the system.
    Possible causes include:
    - you are using a tax group or warehouse which does not have all the required accounts set
    - There is a price rounding and the rounding price account has not been set in the account settings
    - etc.
    The first things I would check include the tax group settings and the G/L Account determination settings.
    Henry

  • How to Create Highlighted text through the API

    I am trying to create a script that goes through a document and cut/pastes specific elements to another document in FrameMaker 7.1.
    So far, I can open a document and if an element is already highlighted/selected, i can cut the whole element using F_ApiCut().
    I am having problems programatically trying to highlight the element that I want to copy.
    So far, I have tried using the exampe from the FDKRef:
            //grab the selected element and set it to the elementRange
            er = F_ApiGetElementRange(FV_SessionId, docId, FP_ElementSelection);
            parentId = F_ApiGetId(docId, er.beg.childId, FP_ParentElement);
            er.end.parentId = er.beg.parentId = F_ApiGetId(docId, parentId, FP_ParentElement);
            // if the selected element is a child of the highest level element, the client returns here
            if(!er.end.parentId) return;
            er.beg.childId = parentId;
            er.beg.offset = er.end.offset = 0;
            er.end.childId = F_ApiGetId(docId, parentId, FP_NextSiblingElement);
            F_ApiSetElementRange(0, docId, FP_ElementSelection, &er);
            F_ApiCut(docId, 0);
    but this only grabs an element that is already selected. Is there a way to select an element through the API?
    Thanks for any help!

    TrainingDeveloper,
    There most certainly is a way. You can set up any kind of selection that you want, although it is definately a tricky process that can throw off even an experienced FDK developer. Here are my observations based on the code you pasted...
    If you want to select an element, the first thing is that you need to have the ID of that element. I don't see anywhere in your code where an element ID is retrieved. All I see is the F_ApiGetElementRange which is getting the current selection, which in turn is likely why you just keep cutting the currently-selected element. If you want to get a specific element, that function call is not applicable. You only need to set up the element range structure to reflect the proper selection and then cut.
    With that, assume that "elemId" is the ID of the element you want to cut. To select an entire element, you would do this:
    F_ObjHandleT elemId, docId;
    F_ElementRangeT er;
    /* . . .   code here to get elemId, docId, etc. . . .  */
    //set up the element range structure for whole-element selection
    er.beg.childId = elemId;
    er.beg.parentId = er.end.parentId =  F_ApiGetId(docId, elemId, FP_ParentElement);
    er.end.childId = F_ApiGetId(docId, elemId,  FP_NextSiblingElement);
    er.beg.offset = er.end.offset =  0;
    //set the element selection in preparation for the cut
    F_ApiSetElementRange(FV_SessionId, docId,  FP_ElementSelection, &er);
    //... and cut
    F_ApiCut(docId, 0);
    I'm not sure what the sample you pasted is meant to accomplish. It is somewhere along the right track but it won't get you exactly what you want.
    Now, I should say that the process of retrieving the desired element ID is a whole different challenge. I'm not sure if you know how to do that or not so I'll defer any discussion on that until you ask.
    Russ

  • Creating SubField Types through DI-API

    Hi,
    I am trying to create SubFieldType of type Quantity through DI API, but it is not creating the SubFieldType. I am using the below code
    DBUpdate.AddFieldToTable(oCompany, "IS_INSROWS", "RejQty", "Rejected Quantity", SAPbobsCOM.BoFieldTypes.db_Numeric, 11,  SAPbobsCOM.BoFldSubTypes.st_Quantity)
    Public Function AddFieldToTable(ByVal oCompany As SAPbobsCOM.Company, ByVal TblName As String, ByVal FldName As [String], ByVal FldDesc As String, ByVal fType As SAPbobsCOM.BoFieldTypes, ByVal fSize As Integer, _
            ByVal subType As SAPbobsCOM.BoFldSubTypes) As Boolean
            Dim oUserField As SAPbobsCOM.UserFieldsMD
            Try
                Dim RetVal As Integer, ErrCode As Integer
                Dim ErrMsg As String
                oUserField = DirectCast(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields), SAPbobsCOM.UserFieldsMD)
                oUserField.TableName = TblName
                oUserField.Name = FldName
                oUserField.Description = FldDesc
                oUserField.Type = fType
                oUserField.SubType = subType
                'oUserField.Size = fSize;
                oUserField.EditSize = fSize
                RetVal = oUserField.Add()
                If RetVal <> 0 Then
                    oCompany.GetLastError(ErrCode, ErrMsg)
                    If RetVal = "-2035" Then
                        Return True
                    End If
                    Return False
                Else
                    Return True
                End If
            Catch ex As Exception
            Finally
                System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserField)
                oUserField = Nothing
                GC.Collect()
            End Try
        End Function
    Regards,
    Noor hussain

    Hi Minhas,
    Thanks a lot for your reply. What about percentage, amount,rate and price in what type does this come ?
    Noor hussain

  • B1DE Advanced setup and creating UDO object during installation

    Hi,
    I am developping addons on B1 2007B and use the B1DE advanced setup package.
    Is there a way in the CustomInstallerClass to connect to the B1 Application to create UDO tables ?
    Regards,
    Grégory

    Hi Gregory,
    Tables and UDOs creation in DI API should not be done during installation. You should do that in your addon after connecting to the DI API.
    You need some code in your addon checking whether the UDT, UDF, UDOs,... already exist, if they don't exist then you create them. You can manage that with a user table were you can keep the current version of your installed addon, this way you can know whether you need to create/update something in your Db every time you start your addon or not.
    Regards,
    Trinidad.

  • Creating Production Order Through DI API Throws Error

    Hi Experts,
    I am trying to create Production orders automatically (using DI API)for Items from a Sales Order Thorough an Intermediate transaction.
    But it throws an error on the line in which I am setting value to the Business partner code of the Production order object.
    The error message shown first is  'Exception from HRESULT: 0xFFFFFFFF'
    and then                         'Object reference is not set to an instance of an object'
    The Code is Given below
    objPrdOrdr = B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oProductionOrders)
                objProdTree = B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oProductTrees)
                With objForm.DataSources.DBDataSources.Item("HeadTab")
                    intRowCount = .Size
                    For intLoopCount = 0 To intRowCount - 1
                        If objForm.DataSources.DBDataSources.Item("LineTab").GetValue("U_POYN", intLoopCount) = "Y" Then
                       *objPrdOrdr.CustomerCode = objForm.DataSources.DBDataSources.Item("HeadTab").GetValue("U_BPCod", 0).ToString*
                            objPrdOrdr.DueDate = objForm.DataSources.DBDataSources.Item("LineTab").GetValue("U_DueDate", 0)
                            objPrdOrdr.ItemNo = objForm.DataSources.DBDataSources.Item("LineTab").GetValue("U_Product", intLoopCount)
                            objPrdOrdr.PlannedQuantity = objForm.DataSources.DBDataSources.Item("LineTab").GetValue("U_QTY", intLoopCount)
                            objPrdOrdr.PostingDate = .GetValue("U_DocDat", 0)
                            objPrdOrdr.ProductionOrderOrigin = BoProductionOrderOriginEnum.bopooSalesOrder
                            objPrdOrdr.ProductionOrderOriginEntry = .GetValue("U_SlOrd", 0)
                            objPrdOrdr.ProductionOrderStatus = BoProductionOrderStatusEnum.boposPlanned
                            objPrdOrdr.ProductionOrderType = BoProductionOrderTypeEnum.bopotSpecial
                            intPrdEnt = objPrdOrdr.Add()
                            If intPrdEnt > 0 Then
                                objPrdOrdr.GetByKey(intPrdEnt)
                                objForm.DataSources.DBDataSources.Item("LineTab").SetValue("U_PrdEnt", intLoopCount, intPrdEnt)
                                objForm.DataSources.DBDataSources.Item("LineTab").SetValue("U_PrdOrd", intLoopCount, objPrdOrdr.DocumentNumber)
                            Else
                                B1Connections.theAppl.SetStatusBarMessage("Production Order Creation Failed", SAPbouiCOM.BoMessageTime.bmt_Short, True)
                                oForm.ActiveItem = "txtBPCod"
                                Return False
                            End If
                            intLoopCount += 1
                        End If
                    Next
                End With
    Please Help... We are using SAP b1 2007B SP00 PL13
    Thanks and Regards
    Ajith G
    Edited by: Ajith G on Mar 12, 2010 10:57 AM - Sorry, Tried to format text properly but failed

    Rectified

  • Create Sales Order through OE_ORDER_PUB  API and get credit card authorizat

    Hi,
    I was trying to know if there is some way to get credit card authorization (when payment type is CREDIT CARD) creating a Sales Order through de OE_ORDER_PUB API.
    I need to reproduce the manual process where you get this authorization, through the Action Button, in the Sales Order Window.
    Thanks in Advance.
    Nicolas.

    Hi Nagamohan,
    Thanks for the reply..It was Vision Instance that i was working on..
    There was some problem in setups. I had run the same script on other instance and it is working.
    Before signing off i have one more doubt...
    The script which i used is creating a sales order with booked_flag='Y' but flow_status_code is still 'ENTERED'
    how can i change it to 'BOOKED' using API...
    Thanks for the help...

  • Create a user through the API and "Prompt user to change password after next login".

    Using the Adobe Connect Interface, I can create a user and check the checkbox to "Prompt user to change password after next login".
    Can I achieve the same result using the API? The principal-update action doesn't offer such an option and, as far as I can tell, there isn't another action to do so either.
    Thank you.

    You can achieve it as part of your application functionality, but not as a configuration option on WLS.

  • Problem in creating user request through ContentDB API

    Hi
    I am trying to create user request on the document. Workflow is configured on the document parent folder. I am trying to submit the document for workflow.
    Here is the code i used to create user request
    RequestManager reqM = session.getRequestManager();
    long[] itemId = { item.getId() };
    NamedValueSet[] docParameters = new NamedValueSet[]
    new NamedValueSet(
    new NamedValue[]
    new NamedValue(Attributes.WORKFLOW_PARAMETER_NAME,"JUSTIFICATION"),
    new NamedValue(Attributes.WORKFLOW_PARAMETER_DEFAULT_VALUE,
    "Edited para 2"),
    new NamedValueSet(
    new NamedValue[]
    new NamedValue(Attributes.WORKFLOW_PARAMETER_NAME,"IFS_ECM_VERBOSE_LOGGING"),
    new NamedValue(Attributes.WORKFLOW_PARAMETER_DEFAULT_VALUE,
    Boolean.FALSE),
    NamedValue[] options2 = new NamedValue[] {
    ClientUtils.newNamedValue(Attributes.WORKFLOW_CONFIGURATION_PARAMETERS,docParameters)};
    reqM.createUserRequest(itemId, options2);
    I got the following error:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: ORACLE.FDK.UnexpectedError:ORACLE.FDK.ServerError
    faultActor:
    faultNode:
    faultDetail:
         {http://xmlns.oracle.com/content/ws}fault:<detailedErrorCode xsi:type="xsd:string">ORACLE.FDK.ServerError</detailedErrorCode><errorCode xsi:type="xsd:string">ORACLE.FDK.UnexpectedError</errorCode><exceptionEntries xsi:nil="true" xsi:type="ns1:ArrayOfFdkExceptionEntry"/><info xsi:nil="true" xsi:type="ns1:ArrayOfNamedValue"/><serverStackTraceId xsi:type="xsd:string">112-1191017621836</serverStackTraceId>
         {http://xml.apache.org/axis/}hostname:contentdb.sjrwmd.com
    ORACLE.FDK.UnexpectedError:ORACLE.FDK.ServerError
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at java.lang.Class.newInstance0(Class.java:350)
         at java.lang.Class.newInstance(Class.java:303)
    However, If i create user request without passing any parameters it is working fine. I get error only when creating request with parameters.
    Please help.

    Hi
    I could able to get the request invoked. Earlier I tried with wrong parameters.
    Thanks

  • How to Create Resource Object in OIM through SQL queries or OIM APIs

    Hello,
    I have to create few (100) resource Objects in OIM. I was creating manually through Design console one by one. In future we might need to create many more Resource Objects .It takes lot of time if we do it through Manually.
    Is there any possiblity we can create Resource Objects through SQL query or OIM APIs ???
    Thanks!!

    Yes. I do it all the time.
    If you are using 11G 11.1.1.3
    Go here
    http://fredforester.org/code/xmlstarters/
    Download the files.
    RESCFORM.xml is an example resource built from the template
    buildtemplate.sh is a shell script that creates a resource from the template
    index.php - you dont need this
    templateresource.xml - this is the template resource. it was created by building a simple resource with all its basic tasks and components then editing it and renaming things so I can find them with sed
    to create Resource C you would
    ./buildtemplate.sh RESCFORM "Resc Resource" "Resc Process"
    you would end up with a file called RESCFORM.xml where when imported would have
    UD_RESCFORM
    Resc Resource Resouce Defintion
    Resc Process Process Defition with basic tasks pointing to a dummy adapter.
    You can optionally create your own prepop so it will get assigned to the form when you import.
    Good luck

  • Error while creating Supplier Contact through API

    Hi,
    I am not able to create supplier contact through an API: ap_vendor_pub_pkg.create_vendor_contact
    The return status (x_return_status)from the API is 'U' and x_msg_data is 'FND'.
    Please help with your suggestions !
    Thanks,
    Sambit

    Hi Hussein,
    Yes the only meesage that is coming in the pot parameter of the API is: 'FND'
    The code snippet is as below:
    ===================================================
    fnd_global.apps_initialize(user_id => v_user_id,
    resp_id => v_resp_id,
    resp_appl_id => v_application_id);
    mo_global.set_policy_context(
    'S', v_org_id);
    v_message := v_message || chr(13) || 'Assigning values for the api ';
    v_vendor_contact_rec_type.vendor_site_id := v_vendor_site_id;
    v_vendor_contact_rec_type.vendor_id := v_vendor_id;
    v_vendor_contact_rec_type.person_first_name := v_first_name;
    v_vendor_contact_rec_type.person_last_name := v_last_name;
    v_vendor_contact_rec_type.email_address := '[email protected]';
    v_vendor_contact_rec_type.org_id := v_org_id;
    v_message := v_message || chr(13) ||
    'Before calling AP_VENDOR_PUB_PKG.CREATE_VENDOR_CONTACT api ';
    BEGIN
    ap_vendor_pub_pkg.create_vendor_contact(p_api_version => v_api_version,
    p_init_msg_list => fnd_api.g_false,
    p_commit => fnd_api.g_false,
    p_validation_level => fnd_api.g_valid_level_full,
    x_return_status => v_return_status,
    x_msg_count => v_msg_count,
    x_msg_data => v_msg_data,
    p_vendor_contact_rec => v_vendor_contact_rec_type,
    x_vendor_contact_id => v_vendor_contact_id,
    x_per_party_id => v_per_party_id,
    x_rel_party_id => v_rel_party_id,
    x_rel_id => v_rel_id,
    x_org_contact_id => v_org_contact_id,
    x_party_site_id => v_party_site_id);
    v_message := v_message || chr(13) ||
    'After calling AP_VENDOR_PUB_PKG.CREATE_VENDOR_CONTACT api: '||v_msg_data;
    =========================================================================
    Output: v_msg_data= FND
    Thanks,
    Sambit

Maybe you are looking for

  • 1st Generation ipod & itrip ?

    Can anybody confirm to me that the itrip works ok with the 1st generation ipod? I am thinking of buying one ... any other issues that people have had with the itrip would be worth knowing about.

  • Problem creating vendor

    Hi Guys,          i was just creating a vendor for my own use. while creating vendor using transaction xk01 the account group field is creating problems. Can you please give me an example of step by step creation of a vendor using xk01

  • Item usage

    hai all.... In determining a item category system takes in to account sales document type,item category group,higher level item category and item usage.so what actually are item usage and higher level item category. item category is linked to item gr

  • Copying manual price conditions

    Hello, We are creating sales order and if we deliver quantity less than the order quantity, we will create a back order with respect to the sales order. In Sales order we are maintaining some manual condition type at header level and when we create b

  • What's wrong with the manifest file????

    when i tried to jar using this command: java -jar aaa.jar i have an error saying: Failed to load Main-Class manifest attribute from aaa.jar so i tried editing my manifest file but no matter wad changes i make to the manifest file the same error occur