Error message when trying to send Emails

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
JHew
Posts: 27
Joined: Thu Jun 25, 2020 12:23 pm

Error message when trying to send Emails

Post by JHew »

I'm trying to set up outgoing emails and I have followed the guide on YouTube but I keep getting the following error: Internal error. java.lang.String cannot be cast to com.bas.shared.domain.operation.Ientity

I've set up the email by doing the following:

- I made my BO intelligent and specified the server, port, and login details in the configuration tool.
- Set up an outgoing email notification and defined the message and subject.
- Put an update rule in the BO: 'if Main_Planning_Data.MDStatus WAS CHANGED TO 'Assessed' Then
SEND MDEmail TO Main_Planning_Data.ProdControlEmail'

To trigger the email to send I have another process linked to a button in operations with records which changes the status referred to in the above rule. It is at this point where the error message comes up.

Does anyone know why this is happening?
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Error message when trying to send Emails

Post by hpl123 »

Difficult to know exactly what the problem is when not seeing your entire setup. I suggest you look at the sample apps e.g the CRM sample app and go over all parts of the email sending to make sure your app is configured correctly. The sample apps are great starter "guides" to see/understand Aware mechanics.
Henrik (V8 Developer Ed. - Windows)
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Error message when trying to send Emails

Post by Jaymer »

This is most likely because you are confused by the naming of Fields.
... AND, because the demo apps DO NOT adhere to the "preferred" "Bailey" naming method of fields.

This error is saying that you're trying to assign a String to BO, or vice-versa.
The error is most likely in just 1 assignment statement somewhere in your code/rules.

The way the sample apps name fields, its hard to tell from looking at Rules if the field on the right side of the = is a field or a relationship.

If you see OutgoingEmail.Recipient = Invoice.Customer
then you cannot tell from only that if Customer is a field in the Invoice table -OR- if Customer is a relationship from Invoice
(in v8.5, the new Coloring helps)
BUT if these fields had been named "better", then it might appear like this:
1) OutgoingEmail.Recipient = Invoice.ps_Customer
this is now clear that you are assigning a BO Instance to Recipient
If you were trying to assign the Customer NAME to Recipient, then you would have had to write this:
2) OutgoingEmail.Recipient = Invoice.ps_Customer.Name

In # 1 above, if Recipient is a Plain Text field, you'd get the error you're getting because as the error says, an "Ientity" (whatever that is in Java) is not the same as a String

In # 2 above, if Recipient was a Reference, then the same would apply in reverse - trying to assign a String (the Cust Name) to a "Ientity"

3) If OutgoingEmail had named its field "correctly", then by observation, you'd be able to see what was required. "OutgoingEmail.ps_Recipient" would IMPLY that it can ONLY be assigned an Instance of a BO, not a field (as in #2)

So, in my opinion, because you've followed examples (almost literally), you've just got a semantic TYPE error somewhere.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply