Coder Social home page Coder Social logo

Comments (8)

Zlatkovsky avatar Zlatkovsky commented on August 10, 2024 1

Adding @annich-MS from the Outlook team.

from office-js.

gregor-mueller avatar gregor-mueller commented on August 10, 2024 1

@annich-MS did you manage to reproduce the issue with the provided example (simpleTestForNullProject.zip)?

from office-js.

annich-MS avatar annich-MS commented on August 10, 2024 1

It appears that you're attempting to create a deep linking scenario. This scenario is not officially supported in any version of outlook. You can request this feature in our User Voice

from office-js.

annich-MS avatar annich-MS commented on August 10, 2024

Hi, are you by chance attempting to get the itemid of an appointment that you are the organizer for? Currently items that you created open in compose mode. Per the documentation here:

The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function

This means that in add-ins being run on an calendar item that you created, you must get the itemid from saveAsync.

from office-js.

gregor-mueller avatar gregor-mueller commented on August 10, 2024

I can not use saveAsync on the item, because the item itself is null. I know that I can not just get the itemId in some cases, that's why my code looks like this:

window.currentItemID = Office.context.mailbox.item.itemId;

if (Office.context.mailbox.item.saveAsync) {
    Office.context.mailbox.item.saveAsync(function (asyncResult) { // HOW TO GET THE ITEM ID
        window.currentItemID = asyncResult.value;
        initialStuff();
    });
} else {
    initialStuff();
}

This will throw the mentioned error: Uncaught TypeError: Cannot read property 'itemId' of null

from office-js.

annich-MS avatar annich-MS commented on August 10, 2024

I'm unable to repro this myself. Is there a way you can give me a gist that repros this?

from office-js.

gregor-mueller avatar gregor-mueller commented on August 10, 2024

I've created a simple test project to reproduce this.

Host the test.html on https://localhost/test.html and load the add-in via the manifest (simpleAddin.xml).

  1. Create a new mail and open the add-in (taskpane). It will write the item as [Object, Object] - all good here!
  2. Create a new appointment.
  3. Copy the itemId from the object (the object is logged to console via the add-in).
  4. Open the following URL with your EXCHANGE_SERVER_URL and the copied ITEM_ID:

https://[EXCHANGE_SERVER_URL]/owa/#ItemID=[ITEM_ID]&exvsurl=1&viewModel=ICalendarItemDetailsViewModelFactory

  1. Open the add-in, it will print out null, as the item is null in this situation.

Test project files:

simpleTestForNullProject.zip

from office-js.

gregor-mueller avatar gregor-mueller commented on August 10, 2024

So no update yet?

from office-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.