Monday, 30 September 2019

Get last 2 digits of field on to listpage

1. Create computed column method. create new field and assigned method to that. drag and drop the field on to listpage.


private static str getLastTwoCharOfCode()
        {
            #define.ViewName(CITProductCategoryView)
            #define.DataSourceName("EcoResCategory")
            #define.FieldSubsegmentId("Code")
            const str datasourceName = 'EcoResCategory';
            const str CodeField = 'Code';

            // Instantiate a DictView object for the view
            DictView viewView1 = new DictView(tableNum(CITProductCategoryView));

            str Code = viewView1.computedColumnString
                    (#DataSourceName,
                    #FieldSubsegmentId,
            FieldNameGenerationMode::FieldList,
                true);
            // create the SQL code snippet that computes the column
            str ret = "Right("+ Code+ ",2)";
            return ret;
    }

1 comment:

  1. Do you need Finance? Are you looking for Finance? Are you looking for finance to enlarge your business? We help individuals and companies to obtain finance for business expanding and to setup a new business ranging any amount. Get finance at affordable interest rate of 3%, Do you need this finance for business and to clear your bills? Then send us an email now for more information contact us now via (financialserviceoffer876@gmail.com) whats-App +918929509036 Dr James Eric Finance Pvt Ltd Thanks

    ReplyDelete