Forum Discussion

Joseph_An's avatar
Joseph_An
Creator II
7 years ago

How to add completion notification automatically in Express ECO when Express ECO is saved?

Hi Expert,

I tried to create C# code to to add completion notification automatically in Express ECO when Express ECO is saved.

      var new_Compeletion_notification = inn.newItem("Express ECO Notification", "add");
      var exp_eco_id = this.getProperty("id","");
      new_Compeletion_notification.setProperty("source_id"  , exp_eco_id);
      new_Compeletion_notification.setProperty("owned_by_id", "8CC42C5770DE42A898EAEBF55091B824");
      Item result = new_Compeletion_notification.apply();

But, the result is -1. 

Would you please help how to do this?

Thanks, Expert!

4 Replies

  • Hi,

    is the 'Express ECO Notification' ItemType a custom one added by youself? Which event type do you use for this one? onAfterAdd?

  • It is not customed one.

    I try to use onAfterAdd.

    Would you please help?

    Thank you.

  • Which Aras version do you use? I have never seen an ItemType called 'Express ECO Notification'. You really have a talble for this one?

    • Joseph_An's avatar
      Joseph_An
      Creator II

      Hi Angelalp, 

      Finally, I found how to solve it. 

      When I use identity ID instead of user ID, I could add complete notification automatically. 

      As you said, Express ECO Notification is customed one. I didn't know that. 

      So, it is right you never heard about it. 

      Anyway, thank you so much for your interest on my issue. I appreciate it.

      var new_Compeletion_notification = inn.newItem("Express ECO Notification", "add");
      new_Compeletion_notification.setProperty("source_id" , exp_eco_id);
      new_Compeletion_notification.setProperty("related_id" , "8CC42C5770DE42A898EAEBF55091B824"); 
      Item result = new_Compeletion_notification.apply();