Hi Everyone,
Greetings of the day.
I am performing the following task in Dynamics 365 F&O
Case: I am getting the financial dimension (Department only) from worker position to PurchReqLine level on PurchReqTable Form
Now, I want to disable that financial dimension (Department only) after getting value in it all other financial dimensions should be editable except department.
Note: Department value noting but the current users assigned department. Eg. If worker ABC has assigned department Finance so, Value & Description will come into Purchase Requisition Line.
I am trying the below code but it's not working.
[FormDataSourceEventHandler(formDataSourceStr(PurchReqTable, PurchReqLine), FormDataSourceEventType::Activated)]
public static void PurchReqLine_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
/*ormBuildControl _build;
PurchReqLine purchReqLine = sender.cursor();
// DimensionEntryControl dimensionEntryControl;// = new DimensionEntryControl(_build,sender.formRun());
LedgerDefaultDimensionEntryController ledgerDefaultDimensionEntryController = LedgerDefaultDimensionEntryController::construct();
//dimensionEntryControl.parmEditableDimensionSet(DimensionAttribute::findByName('Department').RecId);
ledgerDefaultDimensionEntryController.parmDimensionsToAllowEdit(purchReqLine.DefaultDimension);//DimensionAttribute::findByName('Department').RecId);//DimensionLinkAllowFieldEdit += eventhandler(BS_PurchReqTableFormEvtHandler::enableHandler);
*/
}
Also, there is a link of exactly the same scenario but in AX 2012. following is the link, The classes used in that link is not available in D365.
https://syedbaber.wordpress.com/2013/09/23/enabledisable-a-financial-dimension-segment-on-ax-form/
Thanks,
Paresh