Document handling Form in Enterprise portal
Enterprise Portal integrates Microsoft Dynamics AX document management functionality with the Microsoft SharePoint user interface.
Therefore, users can accomplish many of the same document management tasks from Enterprise Portal that they can accomplish from the Document handling form in the Microsoft Dynamics AX client application.
For example, users can accomplish the following tasks from Enterprise Portal:
- Add or delete a document (note or file) from a Microsoft Dynamics AX record.
- View or edit the properties of a document that is attached to a Microsoft Dynamics AX record.
- Open a document that is attached to a Microsoft Dynamics AX record.
- View a list of all documents for single record or a specific record type.
- View a list of the latest documents for a single record or a list of Microsoft Dynamics AX records.
Requirement Overview: In EP While attaching a document if for that Document type if user clicks on HideOnEP checkbox (Not in Standard; it’s a customization)
Path to DocuType Form:- Organisation administration -> Set Up -> Document Management -> Document types
If on client application this is how Document Type Form is:
then expected outcome on EP is following (please refer to Highlighted record in the image below for easy understanding):
Requirement is If we click on checkbox HideOnEP then it should hide on EP and Should not be visible to the Table for which we have attached the Document Type with.
Now if the Document Type form looks like below:
Then on EP We won’t Find the highlighted /selected Document type enlisted in Type ID lookup as shown below :
To Achieve this functionality We need to know where to write code and We cannot personalize the form to see datasource as we see in client application but Since in AX 2012 AOT We have Web where we have EP <relatedForm> datasets where either methods can be written if required or can identify which .cs class can be modified.
Identifying the Dataset.
Step1: Go to that form /Page in Enterprise portal modifications needs to be done. For current requirement path followed is: System administration à Setup à Enterprise Portal à Web Sitesà
View in browser. On the Web page click on Sales tab
On clicking Attachment following form will get opened:
Step2: Right click on Text Field against Type and click on Inspect element (see Image below):
After clicking on Inspect element, following screen will appear:
To find the source for the field where you want to make a change or implement a functionality. Click on left topmost icon and click on Type ID on the EP form , the source script will get highlighted and there you can find the Dataset behind that.
Open AOT in Ax Client Application àWeb à WebFiles à Web Controlsà EPDocuInfoAdd
(Go to this WebControl ; Here you can see the class with c sharp code for this web control)
Open visual studio in your development environment and run it as administrator.
Step 6: In Visual Studio, go to view tab and click on Application explorer and right click on EPDocuInfoAdd and click on EDIT , a script will get opened. Now go to View Tab again and open Solution explorer and open EPDocuInfoAdd.ascx.cs
The code on Left side is the place where we need to write our business Logic. For this task, modification in Lookup was required so you can search using AXLookup keyword as it is a framework class and is used to create lookups in EP as shown in code snippet below:
The code to achieve required functionality involves using proxy so that we can add a range to our required field i.e. hideOnEP. Refer to the code snippet below:
Here Range has been given where it means that if Hide on EP is checked on console application then for that value in lookup will not be visible.
Step 7: Deploy Element in AOT
Step 8: Refresh AOD , data and dictionary for changes to get reflected in EP. Refer to following:
Happy Daxing!!! 🙂