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

How to Bypass Next in COC in D365 X++

create movement journal through code in d365 FO x++