# ActivityNumber Not Auto-Populating on Initial Publish for New Excel Add-in Rows

**URL:** <https://www.dynamicsuser.net/t/activitynumber-not-auto-populating-on-initial-publish-for-new-excel-add-in-rows/87830>\
**Category:** Finance and Operations/AX\
**Created:** [April 18, 2025, 5:39am UTC](https://www.dynamicsuser.net/t/activitynumber-not-auto-populating-on-initial-publish-for-new-excel-add-in-rows/87830 "2025-04-18T05:39:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arvind\_Narayanan](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@Arvind\_Narayanan](https://www.dynamicsuser.net/u/Arvind_Narayanan)\
**Post date:** [April 18, 2025, 5:39am UTC](https://www.dynamicsuser.net/t/activitynumber-not-auto-populating-on-initial-publish-for-new-excel-add-in-rows/87830/1 "2025-04-18T05:39:10Z")

</div>

Hi All,

I’ve implemented a customization for a custom data entity where:

1. We added a new ID field (from an ISV), which is related to the `ActivityNumber`.
2. In the Excel add-in for this entity, when the user enters the ID, the corresponding `ActivityNumber` should automatically populate.

The logic works as expected — but only _after_ the first attempt.

When I create a new line in Excel and enter the ID, I get this message:

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dugusers/original/2X/e/e76fbc426cdf1eb55f41c89cda0a6e7d2c82bb1a.png)

After that, both the ID and `ActivityNumber` fields go blank.

However, when I enter the same values again, the lookup works perfectly, and the `ActivityNumber` populates as expected.

Additionally:

- If I clear `ActivityNumber` on an **existing** line (where ID is already set), the autofill also works fine.
- This issue only occurs on the **first attempt** when creating a **new line**.

Is there a known reason why this happens only for new rows on the first publish attempt? Is there something I need to adjust or another way to ensure the logic triggers correctly on first insert?

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [April 22, 2025, 9:05am UTC](https://www.dynamicsuser.net/t/activitynumber-not-auto-populating-on-initial-publish-for-new-excel-add-in-rows/87830/2 "2025-04-22T09:05:04Z")

</div>

You’ll need to give us more information. We know nothing about your entity and your logic, which data source it’s about and how it’s related to the fields and so on.

What did you find when used the debugger?

Is your logic failing only if you’re importing data through the Data Connector or in other cases as well, such as when writing to the entity from X++? If you don’t know whether it’s specific to Data Connector, well, now you have something new to test to collect more information.
