In my previous walkthroughs on customizing Invoice Capture you have seen how you can add a custom field in Invoice capture solution, and synch it back into D365F&O:
https://community.dynamics.com/edit-blog-post/?blogid=76f73e17-7a13-ef11-9f89-6045bdeb4448&postid=916a7917-f64c-f111-bec7-7ced8dcd240d
For installation and troubleshooting you can always refer to my blog: https://community.dynamics.com/forums/thread/details/?threadid=07981fb5-e3d7-ee11-9079-000d3a8b3756. Additionally you can refer to the documentation from Microsoft learn for more insights: https://learn.microsoft.com/en-us/dynamics365/finance/accounts-payable/invoice-capture-overview
Another common requirement for many clients, is to introduce custom lookup fields in the invoice. For now, the solution only allows you add only DateTime, Currency and string fields. However, there is a way to bring in lookups to your String fields as well.
In the above example, let us try to add a lookup field in the Bank account number itself:
https://community.dynamics.com/edit-blog-post/?blogid=76f73e17-7a13-ef11-9f89-6045bdeb4448&postid=916a7917-f64c-f111-bec7-7ced8dcd240d
For installation and troubleshooting you can always refer to my blog: https://community.dynamics.com/forums/thread/details/?threadid=07981fb5-e3d7-ee11-9079-000d3a8b3756. Additionally you can refer to the documentation from Microsoft learn for more insights: https://learn.microsoft.com/en-us/dynamics365/finance/accounts-payable/invoice-capture-overview
Another common requirement for many clients, is to introduce custom lookup fields in the invoice. For now, the solution only allows you add only DateTime, Currency and string fields. However, there is a way to bring in lookups to your String fields as well.
In the above example, let us try to add a lookup field in the Bank account number itself:

To do this, we can add a FetchXML in the query column of the field in User Defined Settings table >> for the field you added the column:
<fetch>
<entity name = "mserp_bankaccounttablecdrentity">
<attribute name = "mserp_accountid"/>
<attribute name = "mserp_name"/>
<filter type = "and">
<condition attribute = "mserp_sysdataareaid"
operator = "eq"
value = "@legalEntity"/>
</filter>
</entity>
</fetch>
Points to ponder:
Entity name = name of the entity on which you need to perform the lookup. You need to ensure the entity is marked as a virtual entity.
Attribute name = these are the logical names of the columns which you would need to show the lookup columns (in our case Account Id and Name)
Finally inside the <filter type> node, you are passing the value of dataareaid = @legalEntity as the legal entity in which you are currently logged on (much like curext() of X++).
You need to copy the code in the User defined settings field >> Query column for the added column as follows:

Save the same and reload the page for invoice capture. The lookup will appear as shown above.
To do this, we can add a FetchXML in the query column of the field in User Defined Settings table >> for the field you added the column:
<fetch>
<entity name = "mserp_bankaccounttablecdrentity">
<attribute name = "mserp_accountid"/>
<attribute name = "mserp_name"/>
<filter type = "and">
<condition attribute = "mserp_sysdataareaid"
operator = "eq"
value = "@legalEntity"/>
</filter>
</entity>
</fetch>
Points to ponder:
Entity name = name of the entity on which you need to perform the lookup. You need to ensure the entity is marked as a virtual entity.
Attribute name = these are the logical names of the columns which you would need to show the lookup columns (in our case Account Id and Name)
Finally inside the <filter type> node, you are passing the value of dataareaid = @legalEntity as the legal entity in which you are currently logged on (much like curext() of X++).
You need to copy the code in the User defined settings field >> Query column for the added column as follows:
Save the same and reload the page for invoice capture. The lookup will appear as shown above.

Like
Report
*This post is locked for comments