Debug Code using Find All References - D365 - Visual Studio

Rumman Ansari   Software Engineer   2023-05-18   1418 Share
☰ Table of Contents

Table of Content:


Debug Code using Find All References - D365 - Visual Studio

Now, let’s look at an example of how to call a D365 find method.

In any method in the system, you can right click on the method definition and select ‘Find All References‘. Do this now. First, right click on the word ‘find’. Then, select ‘Find All References‘.

Debug Code using Find All References - D365 - Visual Studio

As can be see, the Find Symbol Results window will show locations in code where this method is called. Locate and double click on the record /Classes/RetailTransactionServiceCustomer/Methods/updateCustomerFiscalCode

Debug Code using Find All References - D365 - Visual Studio

After double clicking on the result, a window will open showing the code. See screenshot above.

First, the code declares a table buffer of type ‘CustTable‘, with the name ‘custTable‘.

Second, the find method is called. And the result of that method is assigned to the table buffer variable.

In this instance, the ‘find’ method is a static method. Therefore, to call it use :: (colon colon) instead of a period. Next, pass in any parameter values used to find the record. Finally, when updating or deleting a record, pass in ‘true’ as the value for the parameter _forUpdate.

After setting the table buffer variable, a developer can read, update, or delete the record.

In the above code example, first the field FiscalCode is set. Then, the update() method is called on the table buffer. And finally, the ttscommit; causes the system to write the change to the database. See How to Update Data In D365 for more details.