22 Haziran 2018 Cuma

EF Code First Migrations with output folder

Add-Migration -OutputDir Data\Migrations -Context  ContextName,

Update-Database

20 Şubat 2015 Cuma

Lookup method to other Companies for Axapta 2009

public void lookup()
{


   SysTableLookup       sysTableLookup = SysTableLookup::newParameters(tablenum(InventLocation), this);
    Query                query = new Query();
    QueryBuildDataSource queryBuildDataSource;
    ;

    sysTableLookup.addLookupfield(fieldnum(InventLocation, InventLocationId));
    sysTableLookup.addLookupfield(fieldnum(InventLocation, Name));
    sysTableLookup.addLookupfield(fieldnum(InventLocation, InventSiteId));

    queryBuildDataSource = query.addDataSource(tablenum(InventLocation));
    queryBuildDataSource.addRange(fieldnum(InventLocation,         InventLocationType)).value(queryValue(InventLocationType::Standard));

    changecompany('your other company code')
    {
       sysTableLookup.parmQuery(query);
       sysTableLookup.performFormLookup();
    }
}

14 Kasım 2011 Pazartesi

Tablodaki bir alanı satır sırasına göre güncelleme

Sql üzerinde var olan bir tablonuza yeni alan ekledikten sonra, bu alanın değerini artan bir değer alarak güncellemek için aşağıdaki t-sql kodunu kullanarak yapabilirsiniz


UPDATE t
SET t.RowNo=t.Seq
FROM
(SELECT ROW_NUMBER() OVER (ORDER BY yourorderfield) AS Seq,*
FROm Table)t