Powered By Blogger
Showing posts with label Financial Dimension. Show all posts
Showing posts with label Financial Dimension. Show all posts

Adding a new Financial Dimension D365 FO

 

Here is the process to create a new Financial dimension to a table and to display it in the form.
I am taking an example to add a new field for dimension in Project Category.
  1. Extend the table and add the field for Dimension.          d2.JPG2. Next step is to create an EDT which is specific for ProjCategory. This has to extend “LedgerDimensionValueSet”D13. Create a controller class which refers to the new EDT which we have created.This step is needed to create the dimension entry control for the new field.If this step is missed, dimensions would not be visible in the form . d3.JPG4. Now extend the form and add a new tab for dimension d4.JPG
Build the solution. Now you can see the financial dimension ðŸ™‚

d5

Adding a new Financial Dimension tab in purchase requisition form in D365 FO

 Adding a new Financial Dimension tab in the purchase requisition form in D365 FO.


 For the Purchase requisition table "Save Data per company" is set No.

So we need to add some extra code. For the Line table in standard they have developed. I took the reference from there.

Step 1: Add dimension field in Table.




Step 2: Add dimension control in the form.


In form init method.

	[ExtensionOf(formStr(PurchReqTable))]
	final class PurchReqTable_Extension
	{
	    public void init()
	    {
	        next init();

	        DimensionEntryControl   fCC = DimensionEntryControl as DimensionEntryControl;

	        fCC.parmValidateBlockedForManualEntry(true);     
	    } 
	}


DataSource Active method.

[FormDataSourceEventHandler(formDataSourceStr(PurchReqTable, PurchReqTable), FormDataSourceEventType::Activated)]
public static void PurchReqTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
    PurchReqTable    		purchReqTable   =   sender.cursor();
    DimensionEntryControl    	fCC 		=   sender.formRun().design().controlName("DimensionEntryControl") as DimensionEntryControl;

    fCC.parmCompany(curExt());
    fCC.reactivate();
}


TabPage Active method:

[FormControlEventHandler(formControlStr(PurchReqTable, HeaderTabFinancialDimensions), FormControlEventType::PageActivated)]
public static void HeaderTabFinancialDimensions_OnPageActivated(FormControl sender, FormControlEventArgs e)
{
    PurchReqTable    		purchReqTable   = sender.formRun().dataSource(FormDataSourcestr(PurchReqTable, purchReqTable)).cursor();
    DimensionEntryControl    	fCC 		= sender.formRun().design().controlName("DimensionEntryControl") as DimensionEntryControl;

    fCC.parmCompany(curExt());
    fCC.reactivate();
}


Output:





DisableStandredButton

 My requirement is to disable the delete button for journals that were posted:- After Posting the button is enabled fig:- Line level also th...