Sunday 21 December 2014

method for finding duplicates in table

public static boolean existDuplicateName(MyTable _MyTable )
{
    MyTable MyTable ;

    select firstonly RecId from MyTable
        where MyTable .Name     == MyTable .Name &&
              MyTable .RecId    != MyTable .RecId;

    return (MyTable .RecId != 0);
}


the duplicates in the table may have same name but will have a different rec ID we can use thid functionality  to find the duplicates in the table.

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...