Validating UDF Field

Dear All,
How can I validate a UDF field in Business Partner screen? As I don't want to set any default value for that UDF, I could not make it as Mandatory also. Please help me to resolve this problem.
Thanks in advance.

Hi,
The SBO_sp_TransactionNotification proc can be used for this type of validation but you could also use code in your addon. The benefit of using the proc is that this will work with BPs created using the DI API (eg DTW import or another addon).
As you are only trying to read data on a system form, you can use the DBDataSources already attached to it to check the UDF value. This is a better solution because it does not rely on the UDF tab being open. You cannot use this method to write to the UDF due to the restrictions on a system form.
You could add something like the following to the item pressed event (when BeforeAction is true) of the Add button on the BP form:
SAPbouiCOM.DBDataSource sboDS = (SAPbouiCOM.DBDataSource)sboForm.DataSources.DBDataSources.Item("OCRD");
string sValue = sboDS.GetValue("U_MYUDF", 0).TrimEnd();
if(sValue == "")
      BubbleEvent = false;
      _sboApp.SetStatusBarMessage("You must enter a value in the UDF", SAPbouiCOM.BoMessageTime.bmt_Long, true);
You'll also need to check the form mode to make sure you only validate the field when the form is in Add or Update mode.
Kind Regards,
Owen

Similar Messages

  • DTW - Error occurs when updating UDF field

    Error occurs when updating UDF field:"bank does not exist in the company Application-defined or
    object-defined error65171"
    What is the meaning of this message?
    thanks
    Edited by: Nadav Greifman on Oct 11, 2009 12:39 PM

    You may check these threads forst:
    Invalid valid value '0003' Error 65171
    bank account is missing application -define or object define Error 65171
    Re: Journal entries
    Re: Error importing Incoming Payments using the Data Transfer Workbench
    Thanks,
    Gordon

  • DTW valid user fields

    Dear Experts,
    I am working w/ a customer who has hundreds of OITM valid user fields to set up.  I found the  oUserFields folder in DTW templates, with UserFieldsMD.xlt (corresponds to CUFD) and ValidValuesMD.xlt (corresponds to UFD1).  Seems straigthforward.
    But when running import function of DTW there is no corresponding Business Object for user fields / valid user fields. Or at least not one that is obvious to me.
    What am i missing?  Running 2007A PL 46, DTW 2005.0.23, API version 8.0.181 
    thanks for your help,
    Beverly

    You don't need to include ValidValuesMD.xlt if nothing need to be set.  Try DTW just one or few UDF name by UserFieldsMD.xlt to start.
    Thanks,
    Gordon

  • UDF field in Crystal in Sales Order Layout

    Hi,
    I want to Include UDF field in sales order layout, when i open default layout it shows only standard in RDR1(UDF for rowlevel ) it doesn't shows UDF fields. Now i connected database and re-established OLE DB connection and pulled the RDR1 table, here i can get those UDF created by me. but if i use this UDF field in report details area and this results no values in the layout while preview the report in SAP B1.
    Anyone guide me on this....
    Regards
    sree

    Hi Ivan,
    If you want to populate UDF fields into crystal reports layout then you have to do wat i mentioned earlier.
    1. Go to Menu
    2. choose Database
    3. choose verify database
    4.enter Object Id and Document Number as a input
    5.system will retrieve the values from database and pull all the fields including UDF
    but this doesn't change field length of UDF you have to change it on UDF fields management in SAP by updating the field properties.
    Note: later you can't reduce the length
    Regards
    Sree

  • OIM 11g r2  User  UDF fields  Updation based on AD ID

    Hi,
    We have to update the UDF fields created for the users in OIM using the data from a table.
    This table contains the AD ID, and other fields.
    OIM User (already available) will be updated based on AD ID ….i;e AD ID column will be used to find the user in OIM and then his UDF will be updated based on the respective data from other columns in the table .
    Please can you help me on this task?
    Thanks,

    Your requirement doesn't tell much like when you want to update your user. If it would be on daily basis then go for Schedule Task, if you want to at the time of provisioning then you can have one task and attach your code to bring AD ID in OIM..
    You may leverage Event Handlers as well if your use case requires that.

  • UDF fields missing in Deployment Manager User Metadata export wizzard

    Hi,
    When I try to export UDF-s using Deployment Manager, not all UDF-s appear in the Deployment Manager wizard step1 Search list for User Metadata type.
    It seems that UDF Lookup type-s are not included.
    Also, some text type UDF-s are missing as well, while the rest of the text type UDF-s are in the list.
    I wonder if someone has encountered the issue? Is there any solution for this?
    Thanks in advance.

    Hi,
    I have tried your suggestion, exported sandbox, than published the sandbox. The UDF-s are included in the UserEO.xml.xml file, but are still cannot be retrieved in Deployment Manager wizard step1 Search list.
    Even if I enter the exact name of the attribute (USR_UDF_DEPT_NO) it is not found.
    The problem is even more severe:
    - the UDF missing from the export, which is a lookup type field, cannot be mapped in a GTC connector.
    - this UDF field is NOT CREATED in the DATABASE.
    Error message:
    <Error> <oracle.iam.configservice.impl> <BEA-000000> <The attribute DEPT_NO does not exist!>
    <Error> <oracle.iam.ui.formservice.model.modeler.FormService> <BEA-000000> <Updating User field DEPT_NO with params....failed>
    OIM version: 11.1.2.1.0
    Can someone confirm if this a bug? Is there a workaround?
    Best regards.

  • Spry validation text field across two columns in a table?

    I have a table with two columns.  I can easily insert a spry validated text field into the left cell but when I drag the box over so that box is in the right column and the label is still in the left column then that breaks the widget.
    Is this even possible for me to do or do I have to put the widget in just one column?

    Think I figured it out.
    http://www.adobe.com/devnet/dreamweaver/articles/spry_form_validations.html

  • Is it possible to create a editable pdf with validation(required field) using Adobe Acrobat pro version?

    Hi,
    the subject says it all. I have downloaded the trail version to see if its possible to create a editable pdf with validation(required field) using Adobe Acrobat pro version?
    Basically, I will have to create a pdf form where users fill it and send it back to me. there will be required fields (the textbox and check box) that user need to fill before saving the editable pdf?
    Is it possible. if so, can someone kind enough to point to me right directions?
    Thanks in advance.

    Thanks for reply. What I am trying to achieve is to give an option for the user to download the pdf form and once the user tries to save the pdf, it validates with the required field. I managed to create the editable pdf with required fields option. I just need that validation to be done when user click on save file. How can I achieve this? thanks so much for your help.

  • Using JavaScript to set value of Spry validated text field

    Why can't the value of a text field be set using JavaScript
    when it's validated using the Spry validation widget.
    Example (this works):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <input type="text" name="birthdate" id="birthdate"
    value="">
    Example (this doesnt work):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <span id="birthdate">
    <input type="text" name="birthdate" id="birthdate"
    value="">
    <span class="textfieldRequiredMsg">please enter your
    birthday</span>
    </span>
    <script type="text/javascript">
    <!--
    var birthdate = new
    Spry.Widget.ValidationTextField("birthdate", "none");
    //-->
    </script>
    Is there a way to change the value of a Spry validated text
    field using JavaScript?
    Thanks.

    Why can't the value of a text field be set using JavaScript
    when it's validated using the Spry validation widget.
    Example (this works):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <input type="text" name="birthdate" id="birthdate"
    value="">
    Example (this doesnt work):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <span id="birthdate">
    <input type="text" name="birthdate" id="birthdate"
    value="">
    <span class="textfieldRequiredMsg">please enter your
    birthday</span>
    </span>
    <script type="text/javascript">
    <!--
    var birthdate = new
    Spry.Widget.ValidationTextField("birthdate", "none");
    //-->
    </script>
    Is there a way to change the value of a Spry validated text
    field using JavaScript?
    Thanks.

  • Not able to keep defualt value in UDF Field

    Hello Frnds,
    I have one question to you, I want to keep default value in one of the UDF field which is ContNo which is exist in A/R invoice.
    I want to keep default value =9999999
    So to do this I have followed the following process:-
    First I went to ToolsUser-Defined FieldsManage User FieldsMarketing DocumentsTitleContNo
    then pressing update button there is an option to enter Default value and press OK button.
    After that its taking some 30 mins and giving error of "SEWSY"
    Please help me to let me know the solution.
    Regards,

    Hello Gordon,
    Please note that as per your suggestion now im not updating the udf  by the sql query.
    As i was already trying to update it from as a exclusive user of B1, but its not updating.
    Its always give the error of SEWSY.  At the time of updating there is not user logged on SAP also im updating with the adminstrator role.
    Please suggest me.

  • Spry validation text field issue

    I've put several spry validation text fields on my site and
    you can still click through to the next page without having to
    enter any information. What am I missing?

    Think I figured it out.
    http://www.adobe.com/devnet/dreamweaver/articles/spry_form_validations.html

  • Adf validation date field timestamp

    while doing some validation of comparing date fields with timestamp fields i am finding inconsistent behavior in jdev 11 1 1 5. is this known issue. what is best way to do EO level declarative Compare Greater Than / Less Than validations on fields which are of type date and timestamp ?

    First of all, "ADF" on the view side (which is where UIX is) has undergone some dramatic changes.
    10.1.2 and before: you had UIX
    10.1.3.x: ADF Faces 10g
    11.x: ADF Faces 11g (which, although is JSF like ADF Faces 10g, the component set is so different as to be almost a "new thing")
    So, when you're asking about the view technologies, 10.1.2, 10.1.3, and 11.x are dramatically different. ADF Business Components, even though they have gone through changes, are "the same enough" across the versions as to be understandably similar, but not the view technologies.
    John

  • Unique problem with validation/ making field required

    I have searched the forums trying to find a way to make a field required based on the users selection of a check box, or something else. So far, everything says use nullTest = "error".
    I have tried to do this and get the following results: The red highlighting, which shows up around my other required fields, will not show up unless you click in the text box and then out of it. Weird! Then, when pressing the submit button, it will not actually give you an error message if there is nothing in that text box, as it will if there is nothing in the fields that I originally make required.
    Any thoughts, or fixes would be greatly appreciated.
    Thanks in advance for any help.

    We do the same thing here. We haven't had any issues with the submit not validating the field correctly though. Our only issue was the red highlighting. To get around this, we would call resetdata on the field. resetData clears out the value of the field so you need to store it off and then reset it.
    if (form1.BP1.ChangeActivities.Pos1.Department==1) then $.validate.nullTest = "error" else $.validate.nullTest = "disabled"
    endif
    $=$
    var x = $
    xfa.host.resetData("form1.BP1.ChangeParticulars.Pos1To.DeptNo")
    $ = x

  • Update a UDF field at runtime

    I designed the Sales Order and Sales BOL form in Crystal Reports. I am looking to capture and update an UDF field every time I'm printing the one of those reports in SAP B1 2005 A. The reason for doing this is to display on the report "Original" when printed for the first time, "Duplicate" when printed for the second time and so forth. Is this possible? Thank you.

    You could do a Formatted search on the UDF to change to a value when the Field "Printed" is changed.
    You might want to do "Refresh Regularly" option in Formatted Search.
    Krishnan

  • Choosfromlist in UDF fields

    Hi All,
    I have added some User Defined Fields to Sales Order window. Can I place a choose fromlist in  one of these UDF fields. If can, please give the code.

    Hi Jisha,
    Vasu is right, but you can update the Sales Orders form with a new tab that contains your user fields. And in these fields you can add the CFL has you would do in a standard user form (you can even add the CFL in the XML form).
    Example of the user form:
    <?xml version="1.0" encoding="UTF-16" ?>
    <Application>
         <forms>
              <action type="update">
                   <form FormType="139" uid="">
                        <items>
                             <action type="add">
                                  <item uid="_Family01" type="8" left="25" tab_order="0" width="80" top="160" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="Family01" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
                                       <AutoManagedAttribute></AutoManagedAttribute>
                                       <specific caption="Familia 1"></specific>
                                  </item>
                                  <item uid="Family01" type="16" left="110" tab_order="0" width="150" top="160" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
                                       <AutoManagedAttribute></AutoManagedAttribute>
                                       <specific TabOrder="0">
                                            <databind databound="1" table="OITM" alias="U_Family01"></databind>
                                       </specific>
                                  </item>
                                  <item uid="_Family02" type="8" left="25" tab_order="0" width="80" top="175" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="Family02" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
                                       <AutoManagedAttribute></AutoManagedAttribute>
                                       <specific caption="Familia 2"></specific>
                                  </item>
                                  <item uid="Family02" type="16" left="110" tab_order="0" width="150" top="175" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
                                       <AutoManagedAttribute></AutoManagedAttribute>
                                       <specific TabOrder="0">
                                            <databind databound="1" table="OITM" alias="U_Family02"></databind>
                                       </specific>
                                  </item>
                                  <item uid="_Family12" type="8" left="25" tab_order="0" width="80" top="325" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="Family12" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
                                       <AutoManagedAttribute></AutoManagedAttribute>
                                       <specific caption="Familia 12"></specific>
                                  </item>
                                  <item uid="Family12" type="16" left="110" tab_order="0" width="150" top="325" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
                                       <AutoManagedAttribute></AutoManagedAttribute>
                                       <specific TabOrder="0">
                                            <databind databound="1" table="OITM" alias="U_Family12"></databind>
                                       </specific>
                                  </item>
                             </action>
                        </items>
                   </form>
              </action>
         </forms>
    </Application>
    Than you catch the Sales Order form Load and you load the above form:
    1. Catch the Sales Order form load
    2. Add the new folder by code and update the Sales Order form
    Try
                oForm.Freeze(True)
                oForm.Resize(740, 480)
                Dim PaneLevel As Integer = oForm.PaneLevel
                Dim oNewItem As SAPbouiCOM.Item = oForm.Items.Add("FldFam", BoFormItemTypes.it_FOLDER)
                Dim oItem As SAPbouiCOM.Item = oForm.Items.Item("3") '// 3 = Id of an existing folder in the form
                oNewItem.Top = oItem.Top
                oNewItem.Height = oItem.Height
                oNewItem.Width = oItem.Width
                oNewItem.Left = oItem.Left + oItem.Width
                oNewItem.AffectsFormMode = False
                Dim oFolderItem As SAPbouiCOM.Folder = oNewItem.Specific
                oFolderItem.Caption = "NEW FOLDER"
                oFolderItem.GroupWith("3")
                '// Carregar o ficheiro XML com as modificações ao formulário normal.
                UpdateFormByXML(oCompany, oApplication, pFILES & " rm150_" & GetLanguageCode(oApplication) & ".srf", oForm.UniqueID)
                oForm.Items.Item("FldFam").Visible = True
                oForm.PaneLevel = PaneLevel
                AddFamilyFolder = True
            Catch ex As Exception
                oApplication.MessageBox("AddFamilyFolder(): " & oCompany.GetLastErrorCode.ToString & ", " & ex.Message)
            End Try
        End Function
    Function to update a form
        Public Sub UpdateFormByXML(ByRef oCompany As SAPbobsCOM.Company, ByRef oApplication As SAPbouiCOM.Application, _
                ByRef FileName As String, ByRef FormUID As String)
            Try
                Dim xDoc As Xml.XmlDocument = New Xml.XmlDocument
                xDoc.Load(sPath & FileName)
                xDoc.SelectSingleNode("Application/forms/action/form/@uid").Value = FormUID
                oApplication.LoadBatchActions(xDoc.InnerXml)
            Catch ex As Exception
                oApplication.MessageBox("UpdateFormByXML(): ", oCompany.GetLastErrorCode.ToString & ", " & ex.Message)
            End Try
        End Sub
    Regards,
    Vítor Vieira

Maybe you are looking for

  • Help!! Managed to erase a new second hard drive I added and now the system won't boot up

    I can't believe it!! Having un-successfully tried to add a 2nd 2Tb HD, which wouldn't identify itself properly or erase. I took a HD out of one of my PCs and tried again.  This time the hard drive was identified correctly and using disk utility I era

  • This product is not available in the Australian Store

    I've moved from the UK to Australia and changed my Apple ID from a UK account to an Australian account (i.e. changing CC and address details). I've found however that certain content that I've purchased from the UK Store is not available in the Austr

  • Windows can't open .msi file-

    I've tried for almost a week to upgrade to Safari for the Windows 3.0.4, but keep getting an error message saying that Windows doesn't recognize the .msi file that the update is using. I've tried a number of "Windows" fixes, to no avail. Can anyone h

  • How read a particular word in a file using java

    Hi.. friends I have one problem with reading contents of a file. can u give me the source code how to read a data from file example. ss.txt this file contains following data.. Another Important thing to remember is that the instance variables are cre

  • URGENT!! CELLWRAPPER single and double quot issues???

    REP-50003: Bad parameter:  CELLWRAPPER='I get this error whenever I try and use single or double quotes as a cellwrapper. However if I do [SPACE][SPACE] as a cell wrapper this works fine?Is this a bug? I'm sure we have version "10.1.2.0.2"?