How to Control the financial dimensions of the purchase request

Hello ,

I’m on microsoft dynamics ax 2012 r3, I added a parameter to control the financial dimensions of the purchase request. then i have to do treatment in purchase requests, for example, if the financial dimensions of the lines of requisitions not have the same value , i should show an error message to the user, when I submitted the workflow "Purchase requisition review ’ I don’t know where I have to put this treatment to compare the financial dimensions for each requisition line

thank you for your help

Best regards.

The validation can be done here, \Classes\PurchReqWorkflow\canSubmit

Thank u , how to compare the values of the financial dimensions of all lines of purchase requests

Can you please elaborate the requirement of comparing the financial dimension of all lines?

The main objective of this parameter is to add a control checking a financial dimension is always the same value on a purchase request. it will be used to purchase requisitions eg “main account”, that is to say that the value of the dimension “main account” will be the same for all lines of the same requisition ; else i should show a message to the user .

Is the comparison for a single dimension attribute or whole dimension combination?

I have to compare, follows the setting I specified on the screen setting, if I put the two dimension for exemple “mainaccount and Project” in dimension control list, so I need only compare the values of two financial dimension to the line of a purchase request

Have a look at \Classes\DimensionStorage\compareMainAccounts, this finds if the passed two combinations has the same main account