Selasa, 19 April 2011

Create Own Sequence Number at Ms.Dynamics Ax


spAXrrttaaaaaaaann!! ..

Gowd ... sometimes we need own Sequence Number for our form at Axapta.
so these is code from one of my friends Dwipa Rachmawan(Ms.Dynamics Ax Technical), these code produces the order Number Sequence for our form without enrolled in the system sequence number that already exists in Axapta.

Select one table n create a Method
public void nextTaxInterval()
{
EHCTAXValueAddSubGroup eHCTAXValueAddSubGroup;
;
Select maxof(TaxInterval)
From eHCTAXValueAddSubGroup
where eHCTAXValueAddSubGroup.TaxGroupId == this.TaxGroupId;
// where eHCTAXValueAddSubGroup.TaxSubGroupId != this.TaxSubGroupId;
This.TaxInterval = eHCTAXValueAddSubGroup.TaxInterval + 1;

}

n then at form that contain with that datasource/table, generate Create method
public void create(boolean _append = false)
{
super(_append);
EHCTAXValueAddSubGroup.nextTaxInterval();
//assetDepreciationProfileSpec.nextInterval();
}

Tidak ada komentar:

Posting Komentar

Erorr CS1963 - An expression tree may not contain a dynamic operation.

Kali ini saya mendapatkan erorr dengan code CS1963, padahal sebelumnya saya sudah mendefinisikan 'var item in Model' di @foreach(var...