Just wondering if you have any examples of using IO wihout the dataaware controls. I am trying to create Part and Reference repaltionships in code and am having trouble.
Any examples/documentation would be a great help.
Thanks
Sean
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Example:
Say TOrder, TCustomer and TOrderLine is defined i the Model Explorer.
TOrder has a Parts relationship to TOrderLine and a Reference relationship to TCustomer.
When you can do the following in (pseudo) code:
Customer := TCustomer.Create();
// Set attributes for customer
Customer.Store;
Order := TOrder.Create;
// Add relationship to OrderLine
Line := TOrderLine.Create;
// Set attributes for Line
Order.AddOrderLine(Line);
// OR
Order.OrderLines.Add(Line);
// Reference the customer created earlier.
Order.Customer := Customer;
Order.Store;
The actual name of the "AddOrderLine" method or the "OrderLines" attribute depends on what you enter as attribute name (plural and not plural) when you define the class in the Model Explorer.
Hope this helps...
Regards
Henrik Gttig
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Just wondering if you have any examples of using IO wihout the dataaware controls. I am trying to create Part and Reference repaltionships in code and am having trouble.
Any examples/documentation would be a great help.
Thanks
Sean
I have done this several times.
Can you be more specific about your problem?
Example:
Say TOrder, TCustomer and TOrderLine is defined i the Model Explorer.
TOrder has a Parts relationship to TOrderLine and a Reference relationship to TCustomer.
When you can do the following in (pseudo) code:
Customer := TCustomer.Create();
// Set attributes for customer
Customer.Store;
Order := TOrder.Create;
// Add relationship to OrderLine
Line := TOrderLine.Create;
// Set attributes for Line
Order.AddOrderLine(Line);
// OR
Order.OrderLines.Add(Line);
// Reference the customer created earlier.
Order.Customer := Customer;
Order.Store;
The actual name of the "AddOrderLine" method or the "OrderLines" attribute depends on what you enter as attribute name (plural and not plural) when you define the class in the Model Explorer.
Hope this helps...
Regards
Henrik Gttig