web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Create Fixed Asset using X++

Community Member Profile Picture Community Member

In this blog article, we will see how we can create a Fixed Asset using code based on AssetGroupID.

Add below code in class to create a Fixed Asset,

public void createFixedAsset(AssetGroupId assetGroupId)
{
        AssetTable assetTable;
        NumberSeq numberSeq;
        assetTable.initValue();
        assetTable.assetGroup = AssetGroupId;

        //Initialize Number Seq for Asset Id
        numberSeq = assetTable.initAssetNumberSeq(assetTable.Assetgroup);
        AssetTable.AssetId = NumberSeq.num();        

        //Initialize other fields based on Asset Group                                      
        assetTable.initFromAssetGroupId(assetTable.Assetgroup);

        //Initialize name and Name Alias fron Item Id
        assetTable.Name = InventTable::find('ITM1104').itemName();
        assetTable.NameAlias = assetTable.Name;

        //Validate and Insert Fixed Asset. On insertion asset book is also created
        assetTable.validateWrite();
        assetTable.insert();
    }

The post Create Fixed Asset using X++ appeared first on .


This was originally posted here.

Comments

*This post is locked for comments