cancel
Showing results for 
Search instead for 
Did you mean: 

Messages object

Former Member
0 Kudos

Hi,

I am trying to send a message through the DI API 2004 and i get the following error "No addressee selected for alert". With the 6.5 API everything worked fine.

Here is the code (in delphi):

Message := SBOCOmpany.GetBusinessObject(oMessages) as Messages;

Message.MessageText := 'Text';

Message.Subject := 'Subject';

Message.Recipients.Add;

Message.Recipients.SetCurrentLine(0);

Message.Recipients.UserCode := 'user';

Message.Recipients.UserType := rt_RandomUser;

Message.Recipients.SendInternal := Tyes;

If Message.Add <> 0 Then

...............

Anybody ideas?

Thanks,

Paul

Accepted Solutions (1)

Accepted Solutions (1)

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

I have the same behaviour as you for rt_RandomUser.

I have made it work setting the UserCode to a user of Business One and UserType rt_InternalUser.

Have you already created a message into the Service Market Place? I think you should do it.

Please update this forum if you have the solution.

Regards

Trinidad.

Former Member
0 Kudos

Thanks Trinidad. It works now.

Regards,

Paul

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Paul,

How did you solved it?

I'm really interested on the solution.

Regards

Trinidad.

Former Member
0 Kudos

Hi Trinidad,

I changed the UserType to rt_InternalUser.

The source code is now:

Message := SBOCOmpany.GetBusinessObject(oMessages) as Messages;

Message.MessageText := 'Text';

Message.Subject := 'Subject';

Message.Recipients.Add;

Message.Recipients.SetCurrentLine(0);

Message.Recipients.UserCode := 'Receipent';

Message.Recipients.UserType := rt_InternalUser;

Message.Recipients.SendInternal := Tyes;

If Message.Add <> 0 Then

........................

Regards,

Paul

Answers (0)