Sample method how to write Computed column method in x++

public static server str getSalesLineRecid()

    {

        str SalesLineRecidLoc;

        str RecidLoc = SysComputedColumn::returnField(tablestr(SalesOrderLineV2Entity), identifierstr(SalesLine), fieldstr(SalesLine, RecId));

        str DataAreaIdLoc = SysComputedColumn::returnField(tablestr(SalesOrderLineV2Entity), identifierstr(SalesLine), fieldstr(SalesLine, DataAreaId));

        SalesLineRecidLoc = strFmt(@"select top 1 SalesLine.RecId from SalesLine where SalesLine.RecId = %1 and SalesLine.DataAreaId = %2", RecidLoc,DataAreaIdLoc);

        return   SalesLineRecidLoc;

    }


Comments

Popular posts from this blog

step 20 Update script for service model: AOSService on machine: CR-VM-Test-1

How to Bypass Next in COC in D365 X++