Unique Value Transaction Notification

Hi Experts
I have a problem in Transaction Notification
I have a one UDF and i dont want to repeat the value . so i want to restrict if the value has repetead then system block me to add the sales invoice .
my code is
If @transaction_type = 'A' And @object_type = '17'
Begin
if exists (
select u_dd_amt from ordr a where exists
(select 1 from ordr where u_dd_amt =
a.u_dd_amt)
and  u_dd_amt =
@list_of_cols_val_tab_del
Begin
     select @error = 1, @error_message = 'Duplicate value not allowed in DD Amount field'
   end
end
the always error msg occured whenever i type any valye in UDF field please help me

Buen dia Douglas,
No es posible realizarlo ya que como tu indicas no tiene un Objtype, para poder realizar un transaction debe existir un Objtype.
Saludos,
Wuilmer venegas

Similar Messages

  • Transaction Notification For User Defined Object

    Dear Expert,
    I want to create a transaction notification for my user defined form. I have a matrix on my form which has a field as 'Code'. I want that this field (On Row Level) should have unique values all the time while adding or updating the form.
    Object Type: MaterialMaster
    Table Name: MaterialDetails
    FieldName: U_Code
    Plz help me to get this notification.
    Regards

    Hi Amit,
    Please check below query.
    IF @object_type = 'MaterialMaster' AND @transaction_type IN('A','U') and @error = 0
    BEGIN
    IF ( SELECT COUNT(*)
    FROM MaterialDetails A
    WHERE A.U_Code IN (SELECT U_Code FROM MaterialDetails WHERE  U_Code = @list_of_cols_val_tab_del)
    GROUP BY A.U_Code
    HAVING COUNT(*) > 1
    ) >1
    BEGIN
      set @error = -10
      set @error_message = 'You can not Add Dublicate Code'
    END
    End
    Hope this help
    Regards::::
    Atul Chakraborty

  • Transaction Notification with DI Server

    Hello
    I am developing a Web Site with the DI Server, when I have validations in the Transaction Procedure the error  message is incorrect.
    Message: Could not commit transaction.
    Transaction Notification
    set @error='10'
    set @error_message = 'SP: 123'
    -- Select the return values
    select @error, @error_message
    end
    I made the test with the DI - API  and the message is correct.
    Exists a workaround for this problem???
    Thanks
    Regrats
    Edited by: Andres Naranjo on Sep 1, 2010 1:25 AM

    Hello
    This problem was solved in SAP Business One 8.8 PL20.
    Regards

  • Approval procedure vs Transaction Notification

    Hello dear experts,
    I have an issue with the approval procedures and the validations I have to do using the Transaction Notificacion Stored procedure.
    this is the scenario and conditions to consider:
    1.A purchase order (Doctotal) that are between 0 and 25,000 USD needs an approval.
    2. A purchase order needs to have all the project column filled in before the approval procedure. this column is in the detail of a document, so all the rows have to be filled in with the right project code otherwise when your request have been submmited and your receive the approval you are not allowed to do any changes in the Detail Document.
    I realized that the approval procedure is launched before the Transaction Notification SP.
    So I decided to add a query for the approval procedure considering the validations in the project column:
    SELECT distinct 'true'
    FROM OPOR
    WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99   ---This part works perfeclty!!!
    AND LEN(isnull($[POR1.Project.0],''))>0 and $[POR1.U_SubJob.0]>0  )  --This part does not work
    As you see in the query, I am trying to validate that all the rows have the project code (Project) and a UDF (U_SubJob) filled in.
    Have anybody been done this before? How can I access to the detail values of the document? It is easy to acces values on the header.
    I appreciate any help on this. Thank you very much
    Regards,
    Mary

    Hi,
    You must use both in approval procedure or use both in SBO store procedure transaction notification.
    To request approval for a project, you this following approval query:
    if (SELECT $[$38.31.0]) > ' '
    select 'true'
    the other query is for doctotal approval as follows:
    if ($[opor.doctotalsys.number]) between 0 and 24999.99
    SELECT 'true'
    or
    select distinct 'true' FROM OPOR
    WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99
    Both are able to use and work simultanously.
    JimM

  • Transaction Notification for Blocking Batch

    Dear Experts,
    I am facing a critical situation. My Client wants to Block the material movement  if it is not inspected through Quality Personal. I have already Locked batches through General Settings > Inventory > Batch Status . But it only blocks the batches for Goods Issue and Receipts Transactions. It is not working in case of Inventory transfers.
    I have created UDF on GRPO called U_InspStatus where by default value is Pending once the Quality personal changes the UDF value to Completed then only the batch should be able to move through Inventory Transfer.
    Can anyone help me in creating Transaction Notification on Inventory Transfer Document  which can block batches if there status is pending ?
    Waiting for your replies.
    Regards,
    RK

    Hi Naga,
    Please find below mentioned answer to your queries -
    1. Inventory transfer done by means of posting inventory transfer document? - Yes
    2. Inventory transfer as applicable to customer not vendor. How do you select vendor in inventory transfer document? - Not selecting the customer in Inventory Transfer document not required I am moving material from one warehouse to another.
    3. How did you update inspection status in inventory transfer document - Inspection status is updated in Quality Add on and not in Inventory Transfer. But if I am transferring material from one warehouse to another without Inspection then it should block the batch whose Inspection status is pending.

  • How to UPDATE multiple rows in T1 with unique value from T2

    Hi,
    having on mind update query with where clause:
    WHERE (SELECT LEFT(ColumnName,7) FROM tblName) = emp2.ColumnName
    error:
    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
    The statement has been terminated.
    What am I suppose to change in WHERE clause....
    Note: there is always unique value in T2 while, in T1, there could be both, only one value to be updated or number of them that all need to be updated with that unique value from T2 (alias emp2)
    T1                                            
    T2
    colimn1          column2               column3        column4
    001A001A       string1                001A001       string10
    001A001B        string2                001A005      string20
    001B005A        string3               
    001B005B        string4
    001B005C        string5      
    should become:
    T1                                           
    colimn1          column2            
    001A001A       string10               
    001A001B        string10               
    001B005A        string20               
    001B005B        string20
    001B005C        string20      
    UPDATET1
    SET column2  = emp2.column4
    FROM  T2  as emp2
        WHERE (SELECT LEFT(column1,7) FROM T1 = emp2.column3                      

    Hi daredevil3011,
    Based on my test, the error is caused by where statement in the query. Just as the error message, in your where statement, there is a subquery “SELECT LEFT(ColumnName,7) FROM tblName” follows ”=”, this is not permitted in SQL Server.
    To fix this issue, please modify your query to like below:
    UPDATE T1
    SET column2 = emp2.column4
    FROM T2 as emp2
    WHERE LEFT(column1,7) = emp2.column3
    Reference:
    WHERE (Transact-SQL)
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Sp  transaction  notification  to control  docdate

    Hi,
    i've  this problem.  i've  Sales  Invoceis  ( OINV)  and  Credit  Notes (ORIN)  with  the  same  series
    i  want  to  control,  by  sp  transaction  notification,  that  the user does   not  insert,  for  this  series, a  new  document  with  a  docdate  <  then  the  last  date  insert  about   OINV  or  ORIN   ( because  these  have  the  same  series)
    i've  create  this  procedure:  but  i'm  not  able   to  control  docdate  about  OINV  and  ORIN together
    DECLARE @GroupCode SMALLINT
         DECLARE @DocDate DATETIME
         DECLARE @MaxDocDate DATETIME
         DECLARE @Series INT
         DECLARE @NumAtCard NVARCHAR(100)
         DECLARE @Conta INT
         DECLARE @CardCode NVARCHAR(15)
        DECLARE @IdUtente SMALLINT
    --     ADD     YOUR     CODE     HERE
    -- Select the return values
    IF @object_type = '13' AND @transaction_type = 'A'
              BEGIN
                   SELECT @Series = OINV.Series,   @DocDate = DocDate
                   FROM OINV   WHERE OINV.DocEntry = @list_of_cols_val_tab_del 
                   BEGIN
                        /* 1. inserendo una fattura di vendita la data non deve essere precedente
                               a quella dell'ultima fattura per la stessa serie */
                        --Reperisco la serie a cui il documento appartiene
                        SELECT @MaxDocDate =   MAX(@DocDate)
                        FROM OINV
                        WHERE OINV.Series = @Series AND OINV.ObjType = @object_type
                        IF @DocDate < @MaxDocDate
                        BEGIN
                             SELECT @error = 1002,
                             @error_message = 'La data del documento non può essere precedente a quella dell''ultimo inserito ' + CONVERT(VARCHAR, @MaxDocDate, 103)
                        END

    Hi,
    Correct this
    SELECT @MaxDocDate = MAX(@DocDate)
    FROM OINV
    WHERE OINV.Series = @Series AND OINV.ObjType = @object_type
    to
    SELECT @MaxDocDate = MAX(DocDate)
    FROM OINV
    WHERE OINV.Series = @Series AND OINV.ObjType = @object_type
    Thanks
    Malhaar

  • Variables - unique values

    Hi Guys
    I have a variable with reference characteristic 0Asset_afab. I want only unique values in the input select, ie Depreciation Area = 1 is listed hundreds of times. I want it to appear once.
    Also, How do I create Variable in BI7. All the threads in the forums refer to 3.x.
    Thanks
    Abu Muhammad
    Edited by: abu muhammad bin Amin on May 11, 2009 2:07 PM

    Hi Abu,
    You can refer to 3.x version document also, there is no difference in creating variable in 7.0 except for visualization.
    If you are getting many rows for depriciation area, that means there are some other field which you should consider for selection or you should write customer exit variable. In our case depriciation area are compounded with transaction type.
    Regards,
    kams

  • Unable to Enforce Unique Values, Duplicate Values Exist

    I have list in SP 2010, it contains roughly 1000 items.  I would like to enforce unique values on the title field.  I started by cleaning up the list, ensuring that all items already had a unique value.  To help with this, I used the export
    to excel action, then highlight duplicates within Excel.  So as far as I can tell, there are no duplicates within that list column.
    However, when I try to enable the option to Enforce Unique Values, I receive the error that duplicate values exist within the field and must be removed.
    Steps I've taken so far to identify / resolve duplicate values:
    - Multiple exports to Excel from an unfiltered list view, then using highlight duplicates feature > no duplicates found
    - deleted ALL versions of every item from the list (except current), ensured they were completely removed by deleting from both site and site collection recycle bins
    - Using the SP Powershell console, grabbed all list items and exported all of the "Title" type fields (Item object Title, LinkTitle, LinkTitleNoMenu, etc) to a csv and ran that through excel duplicate checking as well. 
    Unless there's some rediculous hidden field value that MS expects anyone capable of attempting to enforce unique values on a list (which is simple enough for anyone to figure out - if it doesn't throw an error), then I've exhausted anything I can think
    of that might cause the list to report duplicate values for that field.
    While I wait to see if someone else has an idea, I'm also going to see what happens if I wipe the Crawl Index and start it from scratch.
    - Jon

    First, I create index for a column in list settings, it works fine no matter duplicate value exists or not;
    then I set enforce unique values in the field, after click OK, I get duplicate values error message.
    With SQL Server profiler, I find the call to proc_CheckIfExistingFieldHasDuplicateValues and the parameters. After reviewing this stored procedure in content database,
    I create the following script in SQL Server management studio:
    declare @siteid
    uniqueidentifier
    declare @webid
    uniqueidentifier
    declare @listid
    uniqueidentifier
    declare @fieldid
    uniqueidentifier
    set @siteid='F7C40DC9-E5D3-42D7-BE60-09B94FD67BEF'
    set @webid='17F02240-CE04-4487-B961-0482B30DDA84'
    set @listid='B349AF8D-7238-419D-B6C4-D88194A57EA7'
    set @fieldid='195A78AC-FC52-4212-A72B-D03144DC1E24'
    SELECT
    * FROM TVF_UserData_List(@ListId)
    AS U1 INNER
    MERGE JOIN
                NameValuePair_Latin1_General_CI_AS
    AS NVP1 WITH (INDEX=NameValuePair_Latin1_General_CI_AS_MatchUserData)
    ON NVP1.ListId
    = @ListId AND NVP1.ItemId
    = U1.tp_Id
    AND ((NVP1.Level
    = 1 AND U1.tp_DraftOwnerId
    IS NULL)
    OR NVP1.Level
    = 2)
    AND NOT((DATALENGTH(ISNULL(NVP1.Value,
    = 0)) AND U1.tp_Level
    = NVP1.Level
    AND U1.tp_IsCurrentVersion
    = CONVERT(bit, 1)
    AND U1.tp_CalculatedVersion
    = 0 AND U1.tp_RowOrdinal
    = 0 INNER
    MERGE JOIN
                NameValuePair_Latin1_General_CI_AS
    AS NVP2 WITH (INDEX=NameValuePair_Latin1_General_CI_AS_CI)
    ON NVP2.SiteId
    = @SiteId AND NVP2.ListId
    = @ListId AND NVP2.FieldId
    = @FieldId AND NVP2.Value
    = NVP1.Value
    AND NVP2.ItemId <> NVP1.ItemId
    CROSS APPLY TVF_UserData_ListItemLevelRow(NVP2.ListId, NVP2.ItemId,
    NVP2.Level, 0)
    AS U2 WHERE ((NVP2.Level
    = 1 AND U2.tp_DraftOwnerId
    IS NULL)
    OR NVP2.Level
    = 2)
    AND NOT((DATALENGTH(ISNULL(NVP2.Value,
    = 0))      
    I can find the duplicate list items based on the result returned by the query above.
    Note that you need to change the parameter values accordingly, and change the name of NameValuePair_Latin1_General1_CI_AS table based on the last parameter of the
    proc_CheckIfExistingFieldHasDuplicateValues stored procedure. You can review the code of this stored procedure by yourself.
    Note that direct operation on the content database in production environment is not supported, please do all these in test environment.

  • Get unique values from Parent List in Dropdown List SPServices

    I have a dropdown list created using the SPServices ($().SPServices.SPCascadeDropdowns). It works as it should, I just need to add a requirement. I need to be able to filter the Parent Lookup list to show only unique values.
    $().SPServices.SPCascadeDropdowns({
    relationshipList: "ROInsComp",
    relationshipListParentColumn: "AIP-RY",
    relationshipListChildColumn: "NameAndCode",
    parentColumn: "AIP-RY",
    childColumn: "NameAndCode",
    debug: true});
    The issue is that in AIP-RY I have stored Years and each year could be repeated several times
    I followed some of the recommendations from this blog:
    GetListItems Unique Values
    I this is what I tried:
    $.ajax({
    url: weburl+'https://my-site/_layouts/filter.aspx?ListId='+escape('{544C8B6A-C9B3-4BA‌​D-B9CF-B032E5FD07DB}')+'&FieldInternalName='+"AIP-RY" + '&ViewId='+escape('{4B433420-156F-4F4F-9E3C-551DC43B593C}')+'&FilterOnly=1&Filte‌​r=1',
    success: function(data) {
    alert('It worked!');}
    No luck so far! Thanks!
    EM

    Thanks for looking into this. I'm not sure this would work: SPServices.SPCascadeDropdowns
    only works (as far as I know) for elements from the same list.
    EM

  • Getting unique values from internal table

    Hi Gurus,
    From time to time I hit this problem and so far I havn't found any nice solution. I've an internal table with several fields. I would like to get all unique values for one (or several) of these fields. However let say that this table has a lot of entries so making a copy is not an option. Also changing this table in any way is forbiden.
    For example for table below I would like to get all unique values for field Number. In this case it would be 1,2,3,4.
    Name  | Number |
    name1 | 1|
    name2 | 2|
    name3 | 2|
    name4 | 3|
    name5 | 4|
    name5 | 3|
    Can anyone propose me better solution than going in the loop through all entries in table? Maybe there is some ABAP functionality that I don't know about?
    BR
    Marcin Cholewczuk

    Let's say that if I sort this table I won't be able to restore it to previous order which is important for me
    True...If you sort the table you won't be able to restore. So the only option is to copy/move all the records into another table.
    Sorting If you need to retrive unique values. I don't think without sorting the table would be a nice idea and proper programming to proceed ahead.
    Regarding logic, as replied earlier
    Either we can go with DELETE ADJACENT DUPLICATES or proceed as replied in my earlier post. There might be number of algorithms to resolve this. But we cannot go ahead without sorting or looping.

  • Get unique value for a range of values from a table

    Please help to identify the sql to get unique value for following scenario
    Table A has 3 columns
    column1 column2 column3

    user7666373 wrote:
    Please help to identify the sql to get unique value for following scenarioUnique combinations of three columns? If so:
    select DISTINCT column1,column2,column3 from A;SY.

  • Select Statement to Get Unique values in a Column

    I am trying to figure out how to get all the unique values from a
    table column?
    select code from atable sort unique?
    I am running 8.1.7
    Does anyone know how to do this?
    Thanks,

    Hi,
    Here is the code for that.
    Select empno from emp
    group by empno
    having count(empno) = 1
    Regards,
    Ganesh R

  • Getting unique values from an arraylist

    Hi
    I have an arraylist that contains stringbuffer objects. The arraylist has duplicate values of the objects. I have to create another arraylist with only the unique values from the first arraylist. I tried it many ways and using many functions, but no luck. Can someone provide me the code for this , as i need to do this urgently.
    Thank U
    Mansoor,

    > Sanity check: when are StringBuffers equal?
    Same character sequence.
    [EDIT] Or so I thought. Just tested, and found I was wrong. A quick glance at the API confirmed my error; StringBuffer doesn't override Object.equals().
    ~

  • Get previous items unique value in new add item form

    Hi
    I have on list having items related to multiple locations.
    Every location is related to one user.
    When user logs in it filters the list with that users location.
    Now when user click on add new item I want to get the data related to his location using item event listener.
    But in new item form there is no way to get the location of that user in event listener as its new item.
    So I passed the qury string parameter form list and changed the add item form link and form to get the query string paramter as default value in Add new Item form.
    But again when user clicks on save button it redirects to original url without paramter. 
    How to redirect user to url with parameter on click on Save/Cancel.
    Is there any other way to get the previous item unique value in add new item from before executing the event listener?

    Hi,
    According to your post, my understanding is that you wanted to redirect user to url with parameter on click on Save/Cancel.
    You need to modify the onclick event need to as below:
    javascript: {{ddwrt:GenFireServerEvent('__redirect={{Home.aspx?Participant={@Participant}&amp;@Activity={@Activity}}}')}}
    Here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/b506cfe5-650e-4017-b470-9ca0a75cd390/sharepoint-2010-list-how-to-pass-parameters-in-a-url-to-another-page?forum=sharepointcustomizationprevious
    In addition, you can creating an intermediate page which just finds the filed value with a DVWP and then redirect to RedirectURL with the filed value on the Query String.
    For more information, you can refer to:
    Redirect to Another Page from NewForm.aspx with the New Item’s ID
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

Maybe you are looking for