UDF Mandatory

Hi all,
In UDF, can we create Mandatory fields?
eg: if we are adding inventory transfer we need to set particular UDF field as mandatory, if we forgot to add that field it need to show error? is it possible?
Remarks: i know by Customization Tools , mandaory field.
i want to enter data manually or by FMS?
Thanks
Anish

Hi,
you can do it through SP transaction notification.
Try following code (For example at Sales Order)
UDF Mandatory at Sales order----
IF @transaction_type IN (N'A', N'U') AND @object_type = '17'
BEGIN
If exists
(Select t.U_AB From RDR1 t
   Where t.DocEntry=@list_of_cols_val_tab_del and t.U_AB = '-')
Select @error = 1,
   @error_message = N'UDF is must '
END
You can change object type ,udf name and tables as per your requirment.
Regards
Deepak tyagi

Similar Messages

  • A/R invoice (making udf mandatory)

    Hi All Experts,
           I am trying  to make some UDF mandatory in A/R Invoice as object_type '13'  and transaction_type  'A' and 'U'.The problem is it not at all working and this invoice is sent for financial approval ,i am trying this  which is wrong query as
    IF @transaction_type = 'A' AND @object_type = '13'
    BEGIN   
    if exists (Select T0.cardcode from oinv T0 where T0.U_Region is null and T0.DocEntry=@list_of_cols_val_tab_del)
         begin
              SET @error = 10
              SET @error_message = N'Enter Region'
         end
    END
    Can any one guide me with right query in repect to the approval  process.
    Regards,
    Inder

    Hi!
    Try this
    IF @transaction_type = 'A' AND @object_type = '13'
    BEGIN   
    if exists (Select T0.docentry from oinv T0 where (T0.U_Region is null or T0.U_Region = '') and T0.DocEntry=@list_of_cols_val_tab_del)
         begin
              SET @error = 10
              SET @error_message = N'Enter Region'
         end
    END

  • Making UDF Mandatory

    Hello Experts,
    I want to make this UDF mandatory in my item master data. I was referring to: Making UDF's Mandatory .. I tried the code given there and it works!
    However, I also want to make another UDF mandatory in the Business Partner Master Data. I used the same code but it didn't work:
    IF @transaction_type = 'A' AND @object_type = '4'
    BEGIN
    If exists (SELECT T0.CardCode FROM OCRD T0 where T0.U_Telno is null and T0.CardCode=@list_of_cols_val_tab_del)
    begin
    SET @error = 10
    SET @error_message = N'Please Fill In Telephone Number'
    end
    END
    Where did I go wrong? Thanks in advance!

    After reading through some forums on SP, I went on to change the Object Type to 2 and redo the UDF and it works fine now.

  • UDF mandatory based on item group?

    Hello -
    Can someone help me make a user defined field in the BP mandatory only when certain item groups are selected on a sales order? The idea is that we have some products that we sell which require a license to obtain. I would like to force my employees to enter that information (license number and expiration) in the BP if one of those items is selected, knowing just eh groups of items is enough.  Ultimately it would be even much better if the expiration date of said license was check for validity as well...but I'd be happy enough knowing that the license was at least referenced.
    Looking forward to your help!
    Best regards,
    Rob

    I assume the UDF-s are row level UDF-s, because they are connected to the item.
    You need two FMS to set the row level UDF-s according to the item and partner and some code in the SBO_SP_TransactionNotification procedure to prevent adding the document, if it contains an overdue expire date.
    With your real UDF names try to connect the next queries to the U_expiredate and U_licencenumber  fields autorefresh according to the itemcode:
    IF (Select i.ItmsGrpCode from OITM I Inner join OITB g
          on i.ItmsGrpCod = g.ItmsGrpCod Where i.ItemCode=$[$38.1.0]) in ('zyx','xyz')
       Select p.U_bpexpdate from OCRD p where p.CardCode=$[$4.1.0]
    IF (Select i.ItmsGrpCode from OITM I Inner join OITB g
          on i.ItmsGrpCod = g.ItmsGrpCod Where i.ItemCode=$[$38.1.0]) in ('zyx','xyz')
      Select p.U_bplicensenumber from OCRD p where p.CardCode=$[$4.1.0]
    Else Select u2018000000u2019
    and insert this in your  SBO_SP_TransactionNotification stored procedure after the line
    --     ADD     YOUR     CODE     HERE )
    IF @transaction_type IN (N'A', N'U') AND @object_type = '17'
    BEGIN
    If exists
    (Select t.Price From RDR1 t
       Where datediff(d,t U_expiredate,getdate())> 0 and U_licencenumber != u2018000000u2019
            and t.DocEntry=@list_of_cols_val_tab_del)
    Select @error = 1,
       @error_message = N'Licence expired ! '
    END

  • UDF mandatory for specific sales/purchasing doc.

    Hi,
    Is UDF can be made mandatory for a specific sales/purchasing document ?
    Jeyakanthan

    Hello,
    Once UDF has been defined with mandatory checked, It will affect all relevant documents.
    You can use approval procedure to monitor this for specific documet types.
    If the UDF is in header level, you also can use query to set up an approval procedure to trigger it if the field is empty.
    Hope this helps.
    regards,
    maggie An
    SAP Business One Forum Team
    Edited by: Maggie An on May 30, 2008 11:05 AM

  • UDF MANDATORY FOR SALES INVOICE

    Hi ,
    We have created a UDF (Type Date)
    U_Payment ,
    I want to restrict user to add Sales Invoice Without entering the Date in UDF.
    Please Help.
    Thanks,
    Anitha

    Hi Anitha,
    I am assuming that UDF is U_Payment:
    Please use this SP:
    ---Payment Mandatory for Sales Invoice--
    if @object_type='13' and (@transaction_type='A' or @transaction_type='U')
    begin
    if exists(select docentry from OINV where (U_Payment is null or U_Payment='') and docentry=@list_of_cols_val_tab_del)
    begin
    select @error=1, @error_message='Payment Date is Must'
    end
    end
    This Code will also Restrict user to update existing Sales Invoice.
    Hope This Help.
    Regards,
    Sudhir Sharma

  • UDF as Mandatory Fields

    Hi!
    is it possible to make UDFs mandatory fields in SAP B1?
    Thanks
    Riza

    Hi,
    Yes possible.  Please check this document:
    http://scn.sap.com/docs/DOC-48302
    Thanks & Regards,
    Nagarajan

  • Mandatory fields while creating masters in SAP B1

    Hi All
    can some body tell if is there any manual where i get to know the mandatory fields while creating the masters in SAP B1 9.0
    Thanks
    Nidhi Trivedi

    Hi Nidhi.
    In Standard you can make UDF mandatory while Creating it by Checking Mandatory Option in UDF Window.
    If you want to make Standard Field Mandatory then you have to use SP Transaction Notification to make that field Mandatory.
    For other options, Please check below links.
    Mandatory Fields in 60 seconds - YouTube
    how to make a field mandatory in SAP Business one ?
    Making Fields Mandatory
    Mandatory Field Options in SAP Business One- no programming required! | Frontline Consultancy
    Hope this helps
    Regards::::
    Atul Chakraborty

  • Formatted Search Querry for UDF

    Dear All,
            My client is using SAP B1 2007 B PL10. Now I am facing a issue like, I have made a UDF in the A/P Invoice Form and hence made it mandatory. But when i make a UDF field as mandatory I have to write a particular default value.  Hence i have written default Value as 0.
          Now whenever i open the A/P Invoice Form,  the mandatory UDF Field is showing default value as 0. But I want to write a Formatted Search Based Querry in a way that the UDF Field should become Nil whenever I Open the A/P Invoice Form.
          Please guide me in writing the Formatted Search Querry by which the UDF Field which is having a Default Value as '0' should become Nil.
        Regards
    Hitesh Parsawala

    Hi Hitesh ,
    You have two option :
    1.Either donot make ur UDF mandatory at the time of creation
    Use sp_transaction notification to validate
    2. Define UDF manadatory at the neginning
    if user donot change the value , triggger approval procedure through FMS
      I think it is
    Select Distinct 'True' from tablename where <userdefined field =''i
    If user donot change, it is going to triger approval procedure
    <You can look for code in forum if that is not working >
    Hope this helps
    Bishal

  • Creation of mandatory UDF in A.R Invoice

    Dear All,
    I am facing the problem for mandatory field creation.
    Even i write this below code when adding A.R Invoice it mandatory field is not working.
    alter proc SBO_SP_TransactionNotification  
    @object_type nvarchar(20),     -- SBO Object Type 
    @transaction_type nchar(1),   -- [A]dd,  <u>pdate, [D]elete, [C]ancel, C[L]ose 
    @num_of_cols_in_key int, 
    @list_of_key_cols_tab_del nvarchar(255), 
    @list_of_cols_val_tab_del nvarchar(255) 
    AS 
    begin 
    -- Return values 
    declare @error  int    -- Result (0 for no error) 
    declare @error_message nvarchar (200)   -- Error string to be displayed 
    select @error = 0 
    select @error_message = N'Ok' 
    if @transaction_type = 'A' and @object_type = '13'
    begin
    if exists(select T0.docdate from OINV T0 where T0.docentry = @list_of_cols_val_tab_del and
    T0.U_EnvUbTm = null )
    begin
    select @error = 100, @error_message = N'You need enter value to the UDF'
    end
    end
    -- Select the return values 
    select @error, @error_message 
    end
    Please help me.
    Thanks in Advance.
    Edited by: vivek.Y on May 18, 2011 1:57 PM

    Hi Vivek......
    Try this one......
    If @object_type='13' and @transaction_type='A'
    BEGIN
    if exists(select T0.docdate from OINV T0 where T0.docentry = @list_of_cols_val_tab_del and
    T0.U_EnvUbTm Is null )
    BEGIN
    Select @error = -1,
    @error_message = 'You need enter value to the UDF'
    End
    End
    Regards,
    Rahul

  • Mandatory UDF for A/P Invoice

    Hi Experts,
    I have created a UDF U_BillNo in the header lever of marketing documents and kept it as a mandatory field.
    We need to enter the bill no for A/P Invoices at the time of posting.
    What i want is the person cannot post the invoice untill the bill no is entered.if the person didnot enter the bill no means then it needs to show a msg that u cant post invoice without bill no and the billno needs to be refreshed after posting the invoice.
    Pls tell me how to acheive this thru FMS.
    Thanx in advance,
    Best Regards,
    Vamsi.

    Hi Vamsi,
    it is possible on Stored Procedure.
    Try to create this Stored Procedure in TEST Database.
    A/P Invoice Object Type = 22
    if @object_type = '22' and @transaction_type = 'A'
    BEGIN
    if exists (SELECT T0.U_BillNo FROM OPCH T0
    WHERE T0.DocEntry = @list_of_cols_val_tab_del AND T0.U_BillNo=' ')
    begin
    select @error = 1, @error_message = 'you cant post invoice without Bill No'
    end
    end
    OR
    if @object_type = '22' and @transaction_type = 'A'
    BEGIN
    if exists (SELECT T0.DocNum FROM OPCH T0
    WHERE T0.DocEntry = @list_of_cols_val_tab_del AND T0.U_BillNo ISNULL)
    begin
    select @error = 1, @error_message = 'you cant post invoice without Bill No'
    end
    end
    Regards,
    Madhan.

  • Query for SP to make a udf field mandatory

    Hi,
    I got a UDF with name (Received By) in Header of GRPO document if the user does not fill the field the document should not be added. I know this is possible by SP but can any one give me the query for it. I searched i got certain query but i dont Know how to use it Or modify it for my case. Pls help me!
    Thanks,
    Gopal

    ALTER proc [dbo].[SBO_SP_TransactionNotification]
    @object_type nvarchar(25),                     
    @transaction_type nchar(1),               
    @num_of_cols_in_key int,
    @list_of_key_cols_tab_del nvarchar(255),
    @list_of_cols_val_tab_del nvarchar(255)
    AS
    begin
    -- Return values
    declare @error  int                    
    declare @error_message nvarchar (200)           
    select @error = 0
    select @error_message = N'Ok'
    IF @transaction_type = 'A' AND @object_type = '13'
    BEGIN
    if exists (Select T0.cardcode from oinv T0 where T0.UDFName is null and T0.DocEntry=@list_of_cols_val_tab_del)
         begin
              SET @error = 10
              SET @error_message = N'UDF is Null'
         end
    END
    select @error, @error_message
    end
    I have written the above code for AR Invoice Screen.
    Replace 'T0.UDFName' in the Select Statement to your UDF Name

  • Custom udf is not shown in USR table

    hi all,
    i have created 3 custom udf in oim 11g r2 system console in usr form. and then
    got them displayed in my create, modify and view user page in identity console.
    but i cannot find my custom udf's in the database USR TABLE.
    i followed the following to add in create/modify user page
    ogin->identity url->users->create user->enter values for mandatory fields->click customize->leftTopcorner->View->Source->select area->edit->Click Add Content (on left top)->Data Component catalog->scroll down and select User VO->Refresh dialogue box->select the field and click 'Add'->on dropdown select 'ADF Input test w/label->close that window->Check if it added to create user form->save and close customization
    NOTE: hey mine is a clone environment. I have teseted the above on our original envrionment and there i am able to see the udf created in USR TABLE TOO..
    but not in my cloned evnironment of oim.
    do i need to configure some changes in files.???
    please help.
    thank
    Edited by: 972117 on Jan 29, 2013 5:53 AM
    Edited by: 972117 on Jan 29, 2013 5:54 AM

    login to sysadmin console. click on export option. select metadata and export it. save it at your local machine. now agian login sysadmin at cloned machine and select import option finally select this xml and import it.

  • User Created in OIM 11.1.1.5 with null value for mandatory field.

    Hi,
    We had updated one UDF as mandatory field on OIM user form. We can see the * in front of that field. Now if we create the user using web console (Using UI), we are not able to create the user without giving some value in that UDF as it is mandatory. However if we created the user with UDF value as null using Trusted recon, User sucessfully created in OIM. I had attached the screen shot for that user which create in OIM with UDF value as null.
    Is any thing else also need to do to make UDF as mandatory field.
    Regards,
    Sid

    I am not sure this is a bug. Such mandatory checks will often only apply to administrative changes from the GUI. You may not always be able to enforce the same quality of data in reconciled data as you wish to impose for changes made through OIM, and it may prove an issue in some cases if such users could not be reconciled. In this case the use will go into OIM, but you will be forced to populate a value in the mandatory field if you later try to update them in OIM.

  • Issue with the UDF in MM

    Hi All,
    I have trying to use a user defined function in the XI message mapping.
    Here is the code of the User defined function :
    if (a != null)
         return "test";
    else
         return "fail";
    The mapping looks like :
    a -> UDF -> result.
    If I am sending the tag for "a" ; I get the result as "test".
    But I am fully avoiding the tag itself. ( not even the empty tag);  I get the error saying " Cannot produce the target element ...result".
    Can anyone help me in resolving the issue ?
    "a" is defined as an optional field.
    The above case is just a prototype for a big problem.
    Good Day!!!

    Hi
    use the UDF in the following way.
    if(!a.equals(""));
    return("test")
    else
    return("fail");
    if u r getting the error as "Cannot produce the target element ...result"
    then check the occurence for the target field whether the filed  is mandatory or not.
    if it's occurence is 1..1 then u have to map this filed with some source filed.
    Thanks
    Rinku

Maybe you are looking for

  • "Documents In The Cloud" lost after restore

    Hey, My Safari was acting up so I decided to restore my Air to a Time Machine copy that was like 2 weeks old. After doing this my Pages documents have been restored to the date the backup was made! This is horrible, I had some important work in there

  • Can I add radio stations to iTunes?

    Thanks Ryan, but how in the name of our dear lord in heaven do I add a radio station to a smart playlist. All I have is the URL: http://www.garnierstreamingmedia.com/asx/radio538.asp So no drag+drop. Ryan M. Level 3 Joined: Feb, 2003 Posts: 2852 Balt

  • NTLM module for oracle 10g Release 2 Apache on Windows 2003

    Hi, I want to implement autologon on my HTML DB application depending on the Windows username. I understand that I can implement this feature with the Apache module modntlm. Is there anyone who has got this working on Windows 2003 Server in combinati

  • No Apps listed in CC desktop manager after installing Yosemite.

    Just installed Yosemite and the Apps tab of Creative Cloud is now blank. Am on a Macbook Pro. Thanks for any help =) Leah

  • Advanced iptables

    Hi everyone, how I can get the advanced features of IPtables. I mean .... the -m average, the -j ROUTE, etc I try to get with patch-o-matic in the svn repo (netfilter) but when I compile I get a big error "file missing" MakeFile (on the kernel source