Posts

Showing posts from January, 2025

D365FO - X++ View | Assign value to String Computed Column in X++ View

Image
 1. Create a view.  2. Add new field in the customize view. 3. Go to Property >> View Method >> Initially No Method will shown. 4. Go to Methods >> Right Click >> New Method. 5. Write the following X++ code to assigning the value to newly added view field.  public static server  str getValue() { return SysComputedColumn::returnField(viewstr( XXX View Name ) ,identifierStr( YYY DataSource Name ),fieldStr( YYY DataSource Name , ZZZ Field Name )); } Note : Target field's  view (XXX), data source(YYY) and field(ZZZ)  name need to replace in the red color Highlighted 6. Build and Synchronize the database.  7. Select the Newly added field and Go to the Property >> View Method >> .Dropdown and Select the newly created method  getValue(). 8. Build the Project once again. NOTE: if you are facing any issue, you can verify the input value from SQL Trace.