I have a BO called Main and attributes InvoiceAddress (plain text) and SendInvoiceTo (plain text, choices = owner, insurance).
Another BO is Subcontractor which has attributes Specialty (plain text, choice = insurance, etc) and Address (plain text).
If user selects Main.SendInvoiceTo = 'Insurance' then I want Main.Invoice Address to be Subcontractor.address for that Specialty.
My rule Invoice Address: IF Main.SendInvoiceTo='Insurance THEN Main.InvoiceAddress=Subcontractors.Address
I get an error "Possible wrong object identifier Subcontractors is used in path Subcontractors.Address in rule Invoice Address."
This is obviously not the way to do it. Can someone tell me in detail how to do this please?
Rule query
-
- Posts: 304
- Joined: Fri Jun 22, 2007 8:26 pm
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
When you attach a rule to a business object it is usually expected that all attributes are referenced from this object. If they are not, you get this warning (if you ignore the warning Aware IM will assume that the object is in the Context - see the User Guide for the explanation).
In your particular case the object that the rule is attached to is "Main". The rule has "Subcontractors.Address" which is not referenced from the Main object. My guess is that the Main object should have reference to the Subcontractors object, so that you can refer to the Subcontractor from the Main object.
By the way, naming an object in plural is not a good idea - you should name it Subcontractor. Should Main refer to one Subcontractor or multiple Subcontractors? If one, then the rule should say Main.Subcontractor.Address. If multiple, you need to decide which of the related subcontractors the rule should refer to, then find the particular subcontractor from the list of subcontractors referenced by the Main object and then assign the value.
In your particular case the object that the rule is attached to is "Main". The rule has "Subcontractors.Address" which is not referenced from the Main object. My guess is that the Main object should have reference to the Subcontractors object, so that you can refer to the Subcontractor from the Main object.
By the way, naming an object in plural is not a good idea - you should name it Subcontractor. Should Main refer to one Subcontractor or multiple Subcontractors? If one, then the rule should say Main.Subcontractor.Address. If multiple, you need to decide which of the related subcontractors the rule should refer to, then find the particular subcontractor from the list of subcontractors referenced by the Main object and then assign the value.
Aware IM Support Team
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact: