User defined field that looks up a system table?

I want to create a user defined field that looks up parts in the items table (i.e. OITM).
I know I can use a formatted search and that works, but I don't want users to be able to edit the field after the item has been looked up and pasted into the field.
In the user defined field menu, there doesn't seem to be a solution to this. The only solution I can think of is to create a user defined table and then move over the items, and then periodically have the table be updated from the master item table (OITM).
Thoughts?

Here is the stored procedure I wrote, but it doesn't seem to work:
IF @transaction_type IN ('A', 'U') AND @Object_type = '97'
BEGIN
IF NOT EXISTS (SELECT T0.ItemCode, T1.U_Part FROM [dbo].[OITM] T0, [dbo].[OOPR] T1
WHERE T0.ItemCode = T1.U_Part AND T1.DocEntry = @list_of_cols_val_tab_del)
    BEGIN
        SELECT @error = 1, @error_message = 'Testing'
    END
END
So basically, I have a UDF called U_Part in the Sales Opportunity form, which will have a formatted search to look up parts, but if a user changes the text to something else (which is possible because it's a basic text field), then this should look up what is in that UDF and check it against the Item Master and give an error if it doesn't exist. However it isn't doing anything.
Any ideas?
Edited by: Gary Rey on Jan 21, 2009 4:56 PM

Similar Messages

  • User Defined Field that gives the date output of the last price update.

    We would like to create a User Defined Field (UDF) with a Formatted Search (FMS) on the Item Master form that gives the date output of the last price update specifically the wholesale price.
    Last Price Update
    Pricelist 2 = Wholesale
    Is this feasible?
    If it is feasible what is the recommended approach?
    Current working UDF on Item Master.
    /* Date output is based on all the latest updates on the Item Master.*/
    select max(updatedate)
    from aitm
    where itemcode = $[oitm.itemcode]
    Resources that were helpful.
    1.(Note:1165947 - Tracking Item Price Changes.)
    2. Case 4-I6: Query on price updates. Mastering SQL Queries for SAP Business One By: Gordon Du

    Thank you Gordon,
    We are looking for the date output of the 'Last Price Update' based on 'Pricelist 2 = Wholesale' which is the challenge.
    These 2 are the parameters for the date output, I should have mentioned that in my original message.
    Last Price Update
    Pricelist 2 = Wholesale
    Per reading a bunch of other similar Forum Questions it looked like it is might not be possible to do. With there being no date on the AIT1 table and AITM.Updatedate is based on any and all updates not just last 'Last Price Update' and not sure how to use the loginstanc.
    Thanks,
    Vern

  • Can i create user-defined fields that are checkboxes?

    I need to create a set of user defined fields on Activities that are a checkboxes. I cant see any options in the manage user fields dialog to set the field as a checkbox, the only options are alphanumeric, Datetime, Units & Totals etc.
    Can user defined fields be added that appear as checkboxes? if so, how do i do it?

    What you need will not be available by UDF.  You need SDK programming for any Check Boxes.  However, you may use predefined list for UDF to imitate part of functions of the check box.
    Thanks,
    Gordon

  • User defined Field Size limit

    Hi,
    would anyone know if there is a limit of the number of user defined fields that can be addeded to SAP Business One (2004A on SQL server 2000)?
    I think there is (in a diffrenet way). It looks like there is a maximmum byte size  - 8060.
    I have the following user fields already in the business partner master data screen .
    A - alphanumeric size = 50
    B - alphanumeric size = 20
    C - alphanumeric size = 20
    D - alphanumeric size = 20
    E - alphanumeric size = 254
    If I try to change B to size 254 ,This is the error message I get.
    "[CUFD] [Microsoft][ODBC SQL Server Driver][SQL Server] Warnning: The table 'ACRD' has been created but it's maximum row size 'User Fieds - Descr' (8522) exeeds the maximum number of bytes per row (8060)..."
    there is nothig else wqrong with the field exept I cannot make it size 254 (I can if I delete the field E though), so I definitely think it is SAP restricting the size. SQL Server does not have this size restriction. I can manually go and change the size using SQL Server Enterprise manager for example.
    I have managed to change the size directly on ACRD, and
    CUFD but dont thinks this is a very approprite way of handilng it.
    Is this an undocumented restriction/feature in SAP or have I missed reading about this ?
    Thanks in advance,
    Indika.

    Hi Spiros,
    I hope you are right. But I have experiences this with many atleast 3 other seperate installations. They were all SQL Server, ranging from Enterprise versio, to Developer version to standard.
    However I can directly change the size in SQL Server without an issue as I mentioned. This proves that this not an issue with SQL Server. Could it be some sort of a flag in the SAP? I get this on the SAP US demo company for example.
    If anyone else had the problem please do respond.
    Thanks,
    Indika

  • 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

  • [Ask] User Defined Field

    Guys, I have two questions here...Hope you guys can help me solving the problems...
    1. How to make user defined field that link to user defined table?
    2. Can I make Query with Inventory master data as a base?
    Thx guys...

    Hi Dear,
    You can do this through SDK also as
    1) Create one UDT named OCT_ITEMSUBGRP1 as
    CreateTable("OCT_ITEMSUBGRP1", "Item SubGrroup1", 0)
    Create Table Procedure is
    Private Sub CreateTable(ByVal txttablename As String, ByVal txtTableDescription As String, ByVal txtTabletype As Integer)
            Dim iRet As Double
            Try
                OCT_tables = OCT_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
                If OCT_tables.GetByKey(CStr(txttablename)) = False Then
                    OCT_tables.TableName = txttablename
                    OCT_tables.TableDescription = txtTableDescription
                    OCT_tables.TableType = txtTabletype
                    iRet = OCT_tables.Add()
                    OCT_Application.SetStatusBarMessage("The Table " & txttablename & " is Added.", SAPbouiCOM.BoMessageTime.bmt_Short, False)
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(OCT_tables)
                Else
                    OCT_tables = Nothing
                End If
                If iRet <> 0 Then
                    OCT_Application.MessageBox(OCT_Company.GetLastErrorDescription)
                End If
                OCT_tables = Nothing
                GC.Collect()
            Catch ex As Exception
                OCT_Application.MessageBox(ex.Message)
            End Try
        End Sub
    Step 2) Creating the Linked Field
    Create_FieldLinked("OITM", "SubGrp1", "Company Classification", 0, 0, 8, "OCT_ITEMSUBGRP1", "")
    Create Linked Table Procedure is
    Private Sub Create_FieldLinked(ByVal txttablename As String, ByVal txtFieldname As String, ByVal txtFieldDescription As String, ByVal type As Integer, ByVal subtype As Integer, ByVal size As Integer, ByVal linktable As String, ByVal ValidField As String)
            'Create Instance of UserTablesMD object 
            OCT_FieldL = OCT_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
            Try
                OCT_FieldL.Name = txtFieldname
                OCT_FieldL.Type = type
                OCT_FieldL.Size = size
                OCT_FieldL.Description = txtFieldDescription
                OCT_FieldL.SubType = subtype
                OCT_FieldL.TableName = txttablename
                OCT_FieldL.EditSize = size
                If linktable <> "" Then
                    OCT_FieldL.LinkedTable = linktable
                    OCT_FieldL.Size = 8
                    OCT_FieldL.EditSize = 8
                End If
                IretCode = OCT_FieldL.Add()
                OCT_Application.SetStatusBarMessage("The Field " & txtFieldname & " is Added.", SAPbouiCOM.BoMessageTime.bmt_Short, False)
                If IretCode <> 0 Then
                    OCT_Application.MessageBox(OCT_Company.GetLastErrorDescription)
                End If
            Catch ex As Exception
                OCT_Application.MessageBox(ex.Message)
                System.Windows.Forms.Application.Exit()
            End Try
            OCT_FieldL = Nothing
            GC.Collect()
        End Sub
    Hope this will help you..
    Warm Regards,
    Mahendra

  • User Defined Fields & Tables Problem

    After the upgrade to B1 2007 and converting our database to 2005 compatibility as per the upgrade directions, we’re having some weird issues with our user defined fields and tables. 
    •     Our user defined fields that used to be alpha-numeric when set up in B1 are now in the database as nvarchar(MAX), even after updating the fields in the Manage User Defined Fields screen.  B1 is obviously not setting the right field information as per its interface.
    •     We’re can no longer add records to user defined tables through the B1 interface, though we can add them fine through SQL Server or an ODBC interface.  The error we are getting is
    [Microsoft][SQL Native Client][SQL Server]Conversion failed when converting the nvarchar value '-3 @PASSWORDS' to data type int. (CINF)
    .  I don’t understand where this problem is coming from because there isn’t even a data field that is an integer, so I don’t know what it’s trying to convert.

    Derek,
    I would suggest you post this question to SAP Support by creating a message.  Also search for any notes on this from https://websmp201.sap-ag.de/notes
    Suda

  • User Defined Fields & AD Connector

    Hello All
    I am having a bit of trouble understanding the flow of information from Xellerate User to AD connector table/provisioning and was hoping someone could help me out. Basically, I have a set of user defined fields that I need to get provisioned to active directory. I have follow the AD connector documentation for adding the new fields to the resource form and process definition but I still do not see the new values for the data showing up in the UD_ADUser table to be provisioned to AD. Not sure if there is a pre-populate adapter I need to add to move the data from USR to UD_ADUSER or if there is some other data mapping that needs to be done, but any help or guidance (end to end) would be helpful.
    Thanks
    Nick

    Suren
    I did the adapter (pretty much copied the last name adapter) but when I update the values in the web console for the user defined fields, it is not updating the values in the UD_ADUSER table. I am also getting this value in the OIM log...do you know what could be causing this.
    2010-09-09 11:47:00,696 DEBUG [XELLERATE.ADAPTERS] Class/Method: tcAdpEvent/finalizeEntityAdapter entered.
    2010-09-09 11:47:00,696 DEBUG [XELLERATE.ADAPTERS] Class/Method: tcAdpEvent/finalizeEntityAdapter - Data: No Return Value mapping defined - Value:
    2010-09-09 11:47:00,696 DEBUG [XELLERATE.ADAPTERS] Class/Method: tcAdpEvent/finalizeEntityAdapter left.
    I reviewed the mapping in the form adapter properties and made sure there are variables mapped and made sure that the adapter has the proper variables mapped and still seems to be coming up.
    Any help you can give would be appreciated.
    Thanks
    Nick

  • User Defined Field Print Layout Designer print problem

    I am having a problem with a user defined field in the Business Partner - Addresses table. The user defined field is a "directions" text field that is intended to print on packing slips generated from the sales order. When I use the PLD to add the UDF in the header or in the table, all data lines in the body of the report repeat.
    Please advise if others are seeing this and what work around or SAP plans exist to resolve.
    Glen Kinney
    Corrpac
    [email protected]

    Hi Glen,
    I am facing the same problem.
    I need to add UDFs in Business Partners - Addresses at row level. The field will be used for some Taxation Nos. like CST, LST, VAT. I have tried to add. the fields are added and data saved too.
    But when I am going to PLD of Invoice and tried to get, the Business Partners - Addresses Table not showing in the list.
    Shell I have your help to resolve this.
    Thanks a lot.
    With Warm Regards,
    Chintesh Soni
    India

  • Ceartion of User Defined Field in EXCHANGE RATE AND INDEXES

    Hi Experts,
                     I want to create  User Defined Field in EXCHANGE RATE AND INDEXES.But while creating the UDF from User Defined Field-Management unable to find the table for it.Write now My Client are using SAP B1 2007 Ptach-08.Is there any way out to create user defined field in EXCHANGE RATE AND INDEXES.
    Plz help me out on this issue.
    with regards,
    Pankaj K and Kamlesh N

    Pankaj,
    When you do the Manage User Fields area to define a UDF, all the possible areas where UDF's can be created in B1 is listed.  You would be able to create UDF's only on these.
    Suda

  • Error after transport: "User defined field Management hanged"

    i have create the document lines table through dot net code ,after creating tables user defined field management set up hanged .if it is possible the re solution please tell me.
    Srinivasan

    Hi S Thirumurugan ,
    You need to create the table using the SDK...if not the User defined field manangement setup cannot open it table will be inconsistant constraint with the table...
    For adding the table through SDK check the SDK Help...
    With regards,
    MadhuSudhana Rao.G

  • User Defined Fields on System Form

    Dear All,
                   I want to know that how much User Defined Fields can be added on a system form. My problem is that I am developing an add-on for the Item Master Data. And I have used a lot of User Defined Fields on Item Master Data Forms which contains table 'OITM'. Now if I am trying to add any extra User Defined fields in OITM Table, I am not able to do so. I am getting an error as  'Internal Error Occurred'. What can i do regarding this problem.?  Help me. It is something very important.
    Thanks and Regards

    Hi,
    There is theoretically no limit on the number of UDF for a table. there is however a maximum number of characters for a record in SQL Sever.
    As far as I know this is 4000 in SQL Server 2005 and older and 8000 in SQL Server 2008.
    pls check Microsoft for the exact numbers
    Regards
    Ad

  • Passing user-defined field to Backend system

    Hi All,
    Please advice how we can pass user-defined fields of shopping cart to same user-defined fields in purchase requisition/purchase order in backend R/3 system.
    I know there is parameter IT_CUF_ITEM in BADI BBP_CREATE_REQ_BACK. If anyone know how to pass field values by this parameter or otherwise, it will be very helpful to me.
    Thanks & Regards,
    Kamaljit Singh

    Hello Kamaljit,
    If you want to pass the custom parameters then you can use the badi BBP_CREATE_PO_BACK/BBP_CREATE_REQ_BACK to fill the header/Item level parameters.
    while building the item level parameters internal table, make sure that you are passing the header guid and the item number and the R/3 BackEnd table name,Fieldname(R/3 Custom Fieldname) with the value(SRM Custom field value).
    Hope this information will be useful to you.
    Regards,
    Mani.
    Please assign points for usefull answers
    Message was edited by: Mani Sreedharala

  • Missing user-defined fields (project definition) in project inform. system

    Dear PS friends,
    I have extended the CI_PROJ structure with some user-defined fields.
    I have started report RCNCT001 (to analyze these new fields in the project information system). The include RCNPROJR was generated and contains the new fields (table XXL_DATA). Include RCNSOM00 was generated too. This is described in note 43493.
    But Iu2019m still missing the new user-defined fields in the dynamic selection of reports (e.g. CN40).
    What else I have to do? We use SAP_APPL : SAPKH60009
    Thanks in advance for any suggestions!

    have you used user defined field or custom field via exit CNEX......
    User defined fields are activated by configuration using field key
    If you added custom fields then check out OSS note 188663 on how to create a CUS view for dynamic selection.

  • Modifying/Updating User Defined Field in a Scheduled Task

    I've written a notification task to send an e-mail to a manager who has a contract employee with a contract that is about to expire.
    Once we isolate a user who has a contract about to expire, we send a notification to the manager. The date that the notification is sent out should be stored in the USR table in a user-defined field, "USR_UDF_LASTSENT."
    Updating this USR_UDF_LASTSENT field is where I'm having difficulty.
    I've tried using the UserManager in a couple of ways. Suppose I've isolated a single user using SearchCriteria and the UserManager and have a single User object called "currentUser." I want to store a Date object in the user defined field "USR_UDF_LASTSENT". Date today = new Date();
    I've tried: currentUser.setAttribute("USR_UDF_LASTSENT", today); //This will run without error, but when I check the DB there is no change to the attribute.
    With a defined instance of UserManager userManager, I've tried: userManager.modify("USR_UDF_LASTSENT", today, currentUser); //This errored out with this error - oracle.iam.identity.exception.NoSuchUserException: IAM-3054135:No user found for the criteria USR_UDF_LASTSENT-9/24/13 2:58 PM.:USR_UDF_LASTSENT:9/24/13 2:58 PM. It looks like it's doing a search rather than a modification.
    I've also tried using the entity manager in the following way:
    Date today = new Date();
    HashMap<String, Object> mapAttrs = new HashMap<String, Object>(); 
    mapAttrs.put("USR_UDF_LASTSENT", today); 
    EntityManager entMgr = Platform.getService(EntityManager.class); 
    entMgr.modifyEntity("User", currentUser.getEntityId(), mapAttrs);
    But it returns with this error: Failed: oracle.iam.platform.entitymgr.UnknownAttributeException: User : [USR_UDF_LASTSENT]
    Is my entityType, "User" inappropriate in this case? What should be used here?
    How can I Set or Update this user defined field from a scheduled task?

    Thanks guys. I did go to Identity System Administration console and chose 'Export' from under "System Managment" which I believe Kevin may have been hinting at. I got an xml export of the AttributeDefinitions for our user defined fields. In this file, there was a header for the attribute I was looking for:
    <AttributeDefinition repo-type="API" name="LastSent" subtype="User Metadata">
       <multiValued>
       <backendName>usr_udf_lastsent</backendName>
    I put the string "LastSent" in place of USR_UDF_LASTSENT in the EntityManager version of my attempt at this task. I believe this is what Kevin and delhi were getting at.
    This didn't work:
    Date today = new Date();
    HashMap<String, Object> mapAttrs = new HashMap<String, Object>(); 
    mapAttrs.put("USR_UDF_LASTSENT", today); 
    EntityManager entMgr = Platform.getService(EntityManager.class); 
    entMgr.modifyEntity("User", currentUser.getEntityId(), mapAttrs);
    But this did:
    Date today = new Date();
    HashMap<String, Object> mapAttrs = new HashMap<String, Object>(); 
    mapAttrs.put("LastSent", today); 
    EntityManager entMgr = Platform.getService(EntityManager.class); 
    entMgr.modifyEntity("User", currentUser.getEntityId(), mapAttrs);
    I wonder if currentUser.setAttribute("LastSent", today); would work... Hmm.

Maybe you are looking for

  • Text select tool not working properly

    When I use the text select tool, it selects columns, not words in a row, which is what I want. It used to work correctly. I am using Acrobat Pro, version 9.0.0. I tried adding the ALT key, with no good result.

  • Provider Not Found Erro

    At the final step of the SOAP/WSDL wizard I get "An unknown error has occurred" Under details I see: "Provider com.bea.xml.stream.MXParserFactory not found" Is this a missing class or plug in. Or is the WSDL somehow causing this. I searched the WSDL

  • Question on Solaris 10

    Hi, I have a question about the Solaris 10 operating system, when I make the execution of commands in a terminal, it freezes and can no longer continue to run more commands. A to be the problem? thanks

  • Do I need to keep my computer on in order to keep my music on my phone?

    On the actual Music App, does my laptop need to be on in order for me to access my library from my phone? I just want an easier way to keep all my songs with me when my ipod isn't?

  • Stop mobile devices from connecting via anyconnect

    I have Anyconnect Essentials + the mobile license. I dont want mobile devices (like iPhones) connecting to my ASA just yet but may in the future. I know I can remove the mobile license but is there another way. (DAP will not work as I would need prem