Dealing with User Defined Tables with the DI Server

I have a general question about the best way of working with the data in user defined tables using the DI Server. It appears from previous posts that it is not possible to use the standard methods such as UpdateObject. Also since update/insert and delete statements or explicitly forbidden using the ExecuteSQL method then how do we interact with the data in the tables?
Do we need to code our own data access layer for this type of access and is this a good practice?
Is this type of functionality going to be available in a future release of the DI Server?
Thanks

Using SQL for Update/Insert/Delete is not forbidden on UDTs (at least non-UDO UDTs; UDO UDTs are somehow in a gray area since they carry internal fields + e.g. inserts require further manipulation in B1 tables...)...
I.e. using ExecuteSQL to add data into UDTs is OK for DI Server...
HTH,
Frank

Similar Messages

  • Syntax error when creating a user-defined table type in SQL Server 2012

    Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
    CREATE TYPE ReportsTableType AS TABLE 
    ( reportId INT
    , questionId INT
    , questionOrder INT );
    Results:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'AS'.

    Hope these posts could help, 
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
    Regards, Dineshkumar,
    Please Mark as Answer if my post answers your question and
    Vote as Helpful if it helps you

  • What the best way to create User defined table with ADDON purpose

    Hi folks, how are you ?
    I´m beginner in development to business one, and I m studying to develop ISV addons.
    But, during my exercises and analisys, I learned that have two ways to create tables and fields in business one. One way is throght by wizard in business one using Tools Menu > Configuration Tools > User Defined Tables >
    Obs: I ´m using Business One Patch Level 9.
    Other way, is create the tables and fields using DI API
    But, my question is. When I develop one addon, or one UDO form that uses one set of user defined tables or used defined fields that where created by the first way (by wizard in B1), how I deploy this in other business one installation ? The package process will ensure the creation of this tables in another enviroment or I must implement the creation of user defined tables using DI API so that this code is called during the installation?
    If in cases of addon develop I must use DI API to create user defined tables, How can I use my classes with this responsibility in package process ?
    Thanks my friends.

    Hi Renan,
    You just need to put your logic in to the startup of your application, after you've established your connection to the UI API and DI API. All this will be triggered in the constructor of your main class.
    namespace MyNamespace
    public class MyAddon
      bool runAddon = true;
      bool initialised = false;
      const string ADDON_NAME = "My Addon";
      public static void Main()
            MyAddon addOn = new MyAddon();
            if(runAddon)
                  System.Windows.Forms.Application.Run();
            else
             Application.Exit();
      public MyAddon()
            // Connect to SBO session for UI
            if(!SetApplication()) runAddon = false;
      private bool SetApplication()
            // Code goes in here to establish UI API and DI API connections
            // See SDK samples for examples
            // You should also define and filter the UI API events your addon will trap at this stage and create any menus
            // Call your routine to check if the required UDFs/UDTs exist on this company
            initialised = CheckInitialisation();
            if (!initialised)
               //  AddOn not yet intialised on this company so prompt the user to run the intialisation process
              int iResponse = app.MessageBox("The " + ADDON_NAME + " addon will now create all required fields and tables."
                                             + System.Environment.NewLine + System.Environment.NewLine
                                             + "WARNING: It is strongly recommended that all other users are logged out of this company "
                                             + "before running this process. Are you sure you wish to continue?", 2, "Yes", "No", "");
              if (iResponse == 1) initialised = InitialiseAddOn(); // Call your routine to create the objects
            return true;
    Kind Regards,
    Owen

  • Problem in EIS with "user-defined table"

    Platform : z/osrdbms : db2 v7Olap : Db2OlapMy problem :I try to make a "User-Defined table" in a meta-model whith this SQL definitionselect a.idele, a.idele0, b.lbele from u1g.fordv0 a, u1g.eledv0 b where a.iddim = 4 and a.idarb = 10 and a.idele = b.idele and a.iddim = b.iddim(description of the two simple table :CREATE TABLE U1G.ARBD ( IDDIM INTEGER NOT NULL, IDARB INTEGER NOT NULL, LBARB VARCHAR(255) NOT NULL, DTCRE TIMESTAMP NOT NULL WITH DEFAULT, DTMAJ TIMESTAMP ) CREATE TABLE U1G.ELED ( IDDIM INTEGER NOT NULL, IDELE INTEGER NOT NULL, LBELE VARCHAR(255) NOT NULL, DDVAL DATE NOT NULL, DFVAL DATE, DTCRE TIMESTAMP NOT NULL WITH DEFAULT, DTMAJ TIMESTAMP, MDCEL CHAR(1) NOT NULL, TYPE CHAR(1) NOT NULL ) )When i look at this "user-defined table" data in the meta model, it's okWhen i try to use this table as a dimension in a meta-outiline, it's okexcept when i try to load members in a cube.The load result say "the load terminated with errors"I look in the IS log :?Tue Jul 27 10:56:40 2004~ /IS/Worker/0x0/1090922163/Error/-104/Build-PQ72292 {DB2 for OS/390}{ODBC Driver}{DSN07011} DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL ".". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: + - AS <IDENTIFIER> DSNT418I SQLSTATE = 42601 SQLSTATE RETURN CODE DSNT415I SQLERRP = DSNHPARS SQL PROCEDURE DETECTING ERROR DSNT416I SQLERRD = 0 0 0 -1 69 0 SQL DIAGNOSTIC INFORMATION DSNT416I SQLERRD = X'00000000' X'00000000' X'00000000' X'FFFFFFFF' X'00000045' X'00000000' SQL DIAGNOSTIC INFORMATION ERRLOC=1:13:1 ?Tue Jul 27 10:56:40 2004~ /IS/Worker/0x0/1090922163/Informational/-104/Build-PQ72292 SELECT. aa."IDELE0", aa."IDELE", aa."LBELE" FROM.(select a."idele" .., a."idele0" .., b."lbele" from u1g.fordv0 a, u1g."eledv0" b where a.iddim = 4 and a.idarb = 10 and a.idele = b.idele and a.iddim = b.iddim) aaI don't understand why it's working in the meta model (the sql is good, i got the data)and why it's not working in the meta outline ?

    Platform : z/osrdbms : db2 v7Olap : Db2OlapMy problem :I try to make a "User-Defined table" in a meta-model whith this SQL definitionselect a.idele, a.idele0, b.lbele from u1g.fordv0 a, u1g.eledv0 b where a.iddim = 4 and a.idarb = 10 and a.idele = b.idele and a.iddim = b.iddim(description of the two simple table :CREATE TABLE U1G.ARBD ( IDDIM INTEGER NOT NULL, IDARB INTEGER NOT NULL, LBARB VARCHAR(255) NOT NULL, DTCRE TIMESTAMP NOT NULL WITH DEFAULT, DTMAJ TIMESTAMP ) CREATE TABLE U1G.ELED ( IDDIM INTEGER NOT NULL, IDELE INTEGER NOT NULL, LBELE VARCHAR(255) NOT NULL, DDVAL DATE NOT NULL, DFVAL DATE, DTCRE TIMESTAMP NOT NULL WITH DEFAULT, DTMAJ TIMESTAMP, MDCEL CHAR(1) NOT NULL, TYPE CHAR(1) NOT NULL ) )When i look at this "user-defined table" data in the meta model, it's okWhen i try to use this table as a dimension in a meta-outiline, it's okexcept when i try to load members in a cube.The load result say "the load terminated with errors"I look in the IS log :?Tue Jul 27 10:56:40 2004~ /IS/Worker/0x0/1090922163/Error/-104/Build-PQ72292 {DB2 for OS/390}{ODBC Driver}{DSN07011} DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL ".". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: + - AS <IDENTIFIER> DSNT418I SQLSTATE = 42601 SQLSTATE RETURN CODE DSNT415I SQLERRP = DSNHPARS SQL PROCEDURE DETECTING ERROR DSNT416I SQLERRD = 0 0 0 -1 69 0 SQL DIAGNOSTIC INFORMATION DSNT416I SQLERRD = X'00000000' X'00000000' X'00000000' X'FFFFFFFF' X'00000045' X'00000000' SQL DIAGNOSTIC INFORMATION ERRLOC=1:13:1 ?Tue Jul 27 10:56:40 2004~ /IS/Worker/0x0/1090922163/Informational/-104/Build-PQ72292 SELECT. aa."IDELE0", aa."IDELE", aa."LBELE" FROM.(select a."idele" .., a."idele0" .., b."lbele" from u1g.fordv0 a, u1g."eledv0" b where a.iddim = 4 and a.idarb = 10 and a.idele = b.idele and a.iddim = b.iddim) aaI don't understand why it's working in the meta model (the sql is good, i got the data)and why it's not working in the meta outline ?

  • 2.1.1 Problem with User Defined Reports with actions on the context menu

    I use the User Defined Reports quite a lot, and export and publish these to other members of the team as Shared Reports. I'm also quite disappointed that there seems to be no further development in this area of SQL Developer.
    One of the totally undocumented features of User Defined Reports is the ability to attach actions to a context menu, and pass data from the grid to a procedure, for example. Copying, then exporting the sessions report (from All Reports -> Data Dictionary Reports -> Database Administration -> Sessions) exposes the XML for adding actions to the context menu. The snippet for killing a session looks like this:
    <item  reload="true"  reloadparent="false" removeFromParent="false">
      <title>Kill Session</title>
      <prompt type="confirm" >     
        <label>Kill Session?</label>     
        <default><![CDATA[]]></default>     
        <value><![CDATA[]]></value>        
      </prompt>
      <sql><![CDATA[ALTER SYSTEM KILL SESSION '#SID#, #SERIAL#' IMMEDIATE]]></sql>
      <help>Kill the selected session.</help>
    </item>So to add this type of functionality to your own user defined reports, you need to export the report, edit the XML, and import it again. It seems to work fine to add this to the master reports, but if you add an <item> element to the child reports, the context menu items appear on the master report too, and they are duplicated many times. I'm not sure if the action of exporting the report adds to the number of times the context menu appears.
    Warning - if you edit a report using SQL Developer, all the <item> tags are removed. Once you've added actions to a context menu, you can only edit the report by exporting it, modifying the XML and importing it again.
    Has anyone else seen this behavior? Have you found a work-around?
    To the SQL Developer team: Are there any plans to allow the adding of user defined context menu items to reports using the GUI in the near future?

    You're right the context menu needs a GUI desperately. You can request this at the SQL Developer Exchange, so other users can vote and add weight for possible future implementation.
    Regards,
    K.

  • What is the Object Type for User Define table ?

    Dear All Experts,
    I create one of the User Define Table with no. of UDF's
    I already register User Define Table with Unique ID.
    As per my knowledge, Unique ID is our Object type for that User Define Table.
    I want to add Transaction Notification Code for created Used Define Table.
    This Transaction Notification prevents user to must enter name in that form.
    IF (@object_type = 'Z_Roto' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U'))
    BEGIN
    If not Exists (Select T0.DocEntry from [@Z_ROTO] T0 Where ( T0.Name is null  OR  T0.Name = ' ' ) AND T0.Code  = @list_of_cols_val_tab_del )
    begin
    SET @error = 1
    SET @error_message = 'Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
    End
    End
    Please help me for this problem.
    Thanks & Regards,
    Nishit Makadia

    Hi All,
    Thanks for your replay.
    Below code is working for User Define Table's Transaction Notification
    IF (@transaction_type = 'A' OR @transaction_type = 'U') AND @object_type = 'Z_Roto'
    BEGIN
    If Exists (Select T0.Code from [@Z_ROTO] T0 Where ( T0.Name is null  OR  T0.Name = ' ' ) AND T0.Code  = @list_of_cols_val_tab_del)
    begin
    select @error = 10
    select @error_message = 'Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
    End
    End
    Necessary to Remember 4 Things. That are mentioned below.
    1) Register User Define Table (UDT) with using "Object Registration Wizard". For Example : @object_type = 'Z_Roto'
    2) When you define selection criteria then it must be compulsory for use Code Field. For Example : Select T0.Code from [@Z_Roto]
    3) When you define selection criteria then it must be compulsory for use Code for @list_of_cols_val_tab_del.
    4) Use error code as 10 Number
    Thanks & Regards,
    Nishit Makadia

  • How to pop-up a text box for a grid item on a user defined table?

    Hello,
    I have a user defined table with a grid & one of the columns is for comments. What I'm trying to do is to pop up a text box when double clicking in the column field. This would be the same as the Item Details column in the Sales Order ittems grid.
    Thanks,
    Ron

    Please post your question on SDK forum.  Only SDK could meet your need.
    Thanks,
    Gordon

  • Print Layout to User Defined Table

    Hello guyz..
    I want a make preprinted for my user query from user defined table where the header information is from another query.
    I guess, the base template User Report (system) can only show the repetitve data from one query but the header area is not,
    could you help, showing the header information from another query ??
    Thanks Regards

    Ria
    The word is that you cannot use the PLD with user defined tables (i wish it was possible).  So in any case to do that you have to use third party tools such as Crystal Reports and Reporting Services

  • User defined table usage

    Dear Experts,
    I would appriciate your advice on the sales budget screen that I am currently woking on.
    the screen contains a matrix with a cfl on the product group column and a couple of columns stand for  sale figures for each  month.
    this screen will be called form the BP form. so i would pass the selected BP code to my form.
    I am not sure whether a user defined table is the answer to this job.
    if i add productGroup,productCode,cardcode,Jan,Feb, ...  user defined fields to this table then the system will add Code and Name fields automatically to this table, if the userdeined table is the right way to go for this job, what values i should held for the code and name fields considering both of these fields are stand alone primary key fields.
    Many thanks.
    Maryam.

    I usually load the same value into both fields, but since the code field is only eight bytes its kind of limiting.  If you don't have any information to load in the table that would be unique, like a date or year field, (or your product code if its less than 9 bytes & will be unique) then a sequential number works fine.  There are threads on this forum that show different ways to do it, but one way is basically to select max(code) from the table, convert the value to numeric, add one to it and then use it as the value for both fields.
    Here's a link to a thread I posted with some code on the specifics of assigning the next sequential number as code and name:
    [Re: Unique Value in Code and Name]
    Edited by: John Chadwick on Sep 18, 2009 2:53 PM

  • USER DEFINED TABLES IN XL REPORTER

    Hello,
    I have a user defined field based on a user defined table with code and name. I call my user defined field in XL reporter. This field varied with the data that I report. I would like to know how I can add the name of the table in my XL report. We can call additionnal tables, but I don't know how I can write the instruction to do it with a variable field.
    Thanks
    Isabelle LAGUERRE
    Serena
    France

    Isabelle,
    Usere Defined Tables are not supported by the XL Report Writer.  There is not a method to import UTD's at this time.  User Defined Fields (UDF's) are supported.
    Eddy

  • User Defined Table locked when multi users try to save data?

    Hi All,
    I am having a problem with User Define Table (UDT). I am just checking if somebody having the same problem as mine (any patch level).
    I've developed an add-on to save additional data to some UDTs upon saving a Production Order. I added my code in FormDataEvent (After Action = True and ActionSuccess = True).
    Here are my sequences to save the data:
    1. Start Transaction
    2. Remove Existing Data from 3 UDTs linked to the production order number.
    3. Save to table 1, using UserTable object
    4. Call function A to save to table2 , using UserTable object
    5. Call function B to save to table 3, using UserTable object
    6. Commit Transaction.
    Note: I have a try catch and rollback the transaction if any exception thrown by .NET and SAP. Below are parts of my coding to handle exception from SAP
                    If oUserTable.Add() <> 0 Then
                        oCompany.GetLastError(ErrCode, ErrMsg)
                        Throw New ApplicationException(ErrCode & "-" & ErrMsg)
                    End If
    in the try catch block, i add the following code
                If oCompany.InTransaction Then
                    oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                    SBO_Application.MessageBox("[SaveRoute]:" & ex.Message)
                    Return False
                End If
    Now, the issue is in some occasions, when multi users try to save the Production Order, the data get deleted from the UDTs, but some of the data did not get saved yet it did not throw an exception. From our observation, it only happens when multi users are trying to save to the same table.
    Does anybody having the same or similar issue? Really appreciate if you can share on this.
    Many Thanks,
    Harianto Ng

    I Believe you should look carefully where in your code writting, you should start transaction and be sure of using end.transaction commit if the insert sends a succesfull message, and rollback it for negative message.
    I used to start transacción right before .add method
    Wha DBMS are u using?
    Hope it helps.

  • User Defined Table Setting

    Hello Experts,
    I created the User Defined Table in the name of SR NO where i entered the Docment No in Code Field (System generated default field).When i add the Document Number serially when i saved the UDT table then my serial sequence has changed.Could anyone help me out from these problem.
    Regards
    Amol

    Hi Suraj,
    These is my Query when i tried to run @PPC Table then it will not sort the Code & Name the details contain all the information.
    If u have any query please ask.
    SELECT T0.[Code], T0.[Name], T0.[U_0001] as 'Purchase Order No',T0.[U_0002] as 'Sr No', T0.[U_0003] as 'Item Code', T0.[U_0004] as 'Item Description' , T0.[U_9999] as 'Plan Qty', T0.[U_0005] as 'P O Qty', T0.[U_0006] as 'GRN No', T0.[U_0007] as 'GRN Date' , convert(varchar,T0.[U_0008]) as 'Batch Num',convert(varchar,T0.[U_0009]) as ' Heat Num', T0.[U_0010] as 'GRN Qty', convert(varchar,T0.[U_0011]) as 'RM Size',convert(varchar,T0.[U_0012]) as 'Length' , convert(varchar,T0.[U_0013]) as 'Pieces' , convert(varchar,T0.[U_0014]) as 'SO Num' , T0.[U_0015] as 'SO ROWNUM' , T0.[U_0016] as 'SO ItemCode' , T0.[U_0017] as 'SO Item Description' , T0.[U_0018] as 'SO Qty' , T0.[U_0019] as 'SUPP Name'  , T0.[U_0020] as 'Cust Name', T0.[U_0021] as 'Open PO Qty' ,convert(varchar,T0.[U_0022]) as 'SO Tol Size' , T0.[U_0023] as 'SO Condition' , T0.[U_0024] as 'SO Size' , T0.[U_0025] as 'SO Length' , T0.[U_0026] as 'Remarks' , T0.[U_0027] as 'Planning Date' , convert(varchar,T0.[U_0028]) as 'SO Dia MM' , T0.[U_0029] as 'Plan Pieces' , T0.[U_0030] as 'Stock Condition' FROM [dbo].[@PPC]  T0 ORDER BY T0.[U_0008]
    Regards
    Amol

  • CANT execute query with parameter on user defined tables using query genera

    Dear All,
    I have problem when executing query with parameter on user defined tables using query generator.
    It seems SBO cannot accept parameter to query user defined tables.
    I've tried these:
    SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = [%0] --- this FAIL
    I try to pass the value directly without using parameter and It works
    SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = 2 --- this SUCCESS
    This one works
    SELECT * FROM RDOC T0 WHERE T0.width =[%0]  --- this SUCCESS
    and this one works too
    SELECT * FROM RDOC T0 WHERE T0.width = 595  --- this SUCCESS
    Is there anyone can help me ....???
    Thanks,
    Alfa

    I  generated this code using query wizard ....
    SELECT T0.[U_Status] AS 'Document Status' FROM  [dbo].[@ST_PR_H] T0  WHERE T0.[U_Status] = (N'2' )
    and replaced the (N'2' ) with [%0]
    SELECT T0.[U_Status] AS 'Document Status' FROM  [dbo].[@ST_PR_H] T0  WHERE T0.[U_Status] = [%0]
    and It worked ......
    Thanks 4 all .....

  • Error erase Queries in Query Manager- The query is used with user-define...

    Hello Experts
    I have deleted a User Field that had a Formatted Search and now I can not remove it because it is linked according to a UF, the error message is as follows:
    "The query is used with user-defined values [Message 952-23]"
    There will be a way to resolve this issue???
    Thanks in advance

    Hi Juan,
    I have tried this very limited, but the formid, is this a number in your case?
    SELECT * from cshs t0 inner join ouqr t1 on t0.queryid = t1.intrnalkey
    where t1.qname = '[%0]'
    Running this query I can get the form id that I need to recreate, but I have a feeling you already know the form id, is this correct?
    - Is there an error when you try to recreate the form id?
    - Will it not let you recreate the same form id because the id is given by the system?
    If it is not possible to recreate the form id, please prepare a backup and log a message. Support should be able to correct the entry in table cshs.
    Hope it helps.
    Jesper

  • User defined field with Linked Table property

    Hi All,
    I know this has been posted several times but I cannot get this to work.  I am trying to add a user defined field and link it to a table. 
    I am getting the error "The field 'Related Table' should consist of 8 alphanumeric characters with no valid or default values " 
    Everything I check says that the code I am using is correct.  Is it possible the problem is that I am trying to connect to an SAP table instead of a user defined table.  Is it possible to link a user defined field to an SAP table?
    My code below:
                    oUserFieldsMD.TableName = "OITM"
                    oUserFieldsMD.Name = "SHP"
                    oUserFieldsMD.Description = "Must ship via"
                    oUserFieldsMD.LinkedTable = "OSHP"
                    oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Alpha
                    oUserFieldsMD.SubType = SAPbobsCOM.BoFldSubTypes.st_None
                    oUserFieldsMD.EditSize = 8
                    oUserFieldsMD.Size = 8
                    oUserFieldsMD.Mandatory = SAPbobsCOM.BoYesNoEnum.tNO
    Thanks
    Karen

    Hello  Karen,
    you cannot link a userfield to a system table. it has to be link to a user table.
    oUserFieldsMD.LinkedTable = "OSHP"
    when you have error, just try to do it using the same value in the application. If you cannot do it, it means you cannot do it neither with the DI
    Sebastien

Maybe you are looking for

  • My HP Color Laserjet CP 1215 recently started printing crooked.

    My Printer at work, HP Color Laserjet CP1215 recently has started printing crooked.  I have open all doors to check for anything stuck in the printer that could be causing it to print crooked.  Any suggestions would be greatly appreciated as I am not

  • Survey code not working

    Ok so I'm making a survey for a website and I have a series of questions where the user can rate it from a list of choices and I have these questions in a table in access and the rating options in a table. I want to have the questions display with th

  • Color edited in DaVinci then exported from Premiere the color changes a lot in final product. Are my export setting wrong?

    I used davinci lite resolve to color edit my footage then I exported round trip to Final cut pro (premiere). Then exported out of premiere and it doesn't look the same at all. What can I do to fix this problem? I have exported from davinci in 10 bit

  • Info about a new worm (Mytob.GV)

    Hello forum users I have found a very interesting article about a new worm that can be very dangerous for your system. The Spanish anti-virus software provider Panda software warns of a new variant of the Mytob Wurms. More data about this worm you ca

  • Macbook pro does not shut down or restart

    i have mid 2009 macbook pro. After i installed mavericks on it, everytime i let my computer stay on for more than 2 hrs or if i put it to sleep, it does not let me open any application. And also it doesnt restart or shut down. I can't copy, erase or