4.5 Create and Display One-to-One Relationships

4.5 Create and Display One-to-One Relationships

  
When I published, I got this error message:

"Database Upgrade Error
 
Field 'OSUSR_2xi_ShippingDetails1.ID' exists in database as Autonumber. Autonumber attributes can not be changed."

I did everything exactly as the instructor did with respect to Shiiping Details. I do not understand where the error is.
Hi Sam,

Apparently you published the ShippingDetails entity first with the ID attribute as the identifier of that entity instead of changing the type to Purchase Identifier as indicated on the video.
No worries. Just delete the entity and recreate it.
As a side note, the OutSystems Platform will not remove the table in the database it will create a new one so if you had any data on that other table you would still have a chance to retrieve it. Because of this characteristic of the OutSystems Platform you might encouter some messages when you publish indicating that some attributes in the database table don't have a corresponding attribute in the entity on your application. This indicates that you have had an attribute on that entity that later (between publish operations) you have removed.

Cheers
I am trying to solve the one-to-one display relationships,but i do not know why (I follow all the steps in the video) I did't find the ShippingDetail reference in the TableForm!!! Why??

See a pict of my Screen.

TIA
Alberto
Hi Alberto,

I believe you forgot to add he ShippingDetails entity to the aggregate.
André Vieira wrote:
Hi Alberto,

I believe you forgot to add he ShippingDetails entity to the aggregate.
 
 Thanks for your answer. I did find my mistake. In the TableForm I connect to the Order entitie insted of current.record

Once again thanks for your help

hello,

I do not see the error which you see on 3:57 on the video.
I will include my progress.
Roelof Wobben wrote:

hello,

I do not see the error which you see on 3:57 on the video.
I will include my progress.
 Hi,

This seems to be a bug to me. Continue changing the Source parameter as the video indicates, and please submit this bug using the submit feedback option on the Help menu.
 
Thanks, I have send the message.

Roelof



André Vieira wrote:
Roelof Wobben wrote:

hello,

I do not see the error which you see on 3:57 on the video.
I will include my progress.
 Hi,

This seems to be a bug to me. Continue changing the Source parameter as the video indicates, and please submit this bug using the submit feedback option on the Help menu.
 
 
 

I've checked with the team and this is not actually a bug :).
They have actually introduced a change that removes the error you see on the video. If you pass something that has an Order to the CreateOrUpdate, like in our video where the Form.Record is actually a record of Order and ShippingDetails, the CreateOrUpdate will use the Order values from that record, in this case you don't need to change the expression anymore.

Cheers
Thanks,

So the video is outdated.

Roelof


André Vieira wrote:
I've checked with the team and this is not actually a bug :).
They have actually introduced a change that removes the error you see on the video. If you pass something that has an Order to the CreateOrUpdate, like in our video where the Form.Record is actually a record of Order and ShippingDetails, the CreateOrUpdate will use the Order values from that record, in this case you don't need to change the expression anymore.

Cheers
 
 

I send in another feedback message because when publishing I see this error :

Internal Error

Compilation Error.
OrderDetail.aspx.cs(863,44): error CS0030: Cannot convert type 'ssOrders.RCShippingDetailsOrderRecord' to 'ssOrders.RCOrderRecord'
OrderDetail.aspx.cs(863,23): error CS0411: The type arguments for method 'OutSystems.HubEdition.RuntimePlatform.Db.RecordUtils.Convert<S,T>(S, T, OutSystems.HubEdition.RuntimePlatform.Db.ConvertFunction<S,T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.


State: Second stage compilation


Roelof Wobben
wrote:
Thanks,

So the video is outdated.

Roelof


André Vieira wrote:
I've checked with the team and this is not actually a bug :).
They have actually introduced a change that removes the error you see on the video. If you pass something that has an Order to the CreateOrUpdate, like in our video where the Form.Record is actually a record of Order and ShippingDetails, the CreateOrUpdate will use the Order values from that record, in this case you don't need to change the expression anymore.

Cheers
 
 
 
 
 
Hi,

Try changing the changing the CreateOrUpdateOrder that you have on the Save action of the OrderDetail screen. Send  OrderForm.Record.Order instead of OrderForm.Record

If you cannot fix the issue, please contact OutSystems support. They'll be able to help you out.
 
Then it works. I have already contacted the support but heard nothing yet from them.

Roelof



Joao Fernandes wrote:
Hi,

Try changing the changing the CreateOrUpdateOrder that you have on the Save action of the OrderDetail screen. Send  OrderForm.Record.Order instead of OrderForm.Record

If you cannot fix the issue, please contact OutSystems support. They'll be able to help you out.
 
 
 

How can I can contact support the best. I ask by using feedback and by asking a outsystems expert but on both no replies.

Roelof

Roelof Wobben wrote:
Then it works. I have already contacted the support but heard nothing yet from them.

Roelof



Joao Fernandes wrote:
Hi,

Try changing the changing the CreateOrUpdateOrder that you have on the Save action of the OrderDetail screen. Send  OrderForm.Record.Order instead of OrderForm.Record

If you cannot fix the issue, please contact OutSystems support. They'll be able to help you out.
 
 
 
 
 
 

Roelof,

What is the issue you are having?
The submit feedback is very important as it help us keep on improving OutSystems Platform fixing the bugs that sneak pass our QA process.
Depending on the license agreement you have you may open support cases to solve your issues (www.outsystems.com/goto/outsystems-support-terms).
Even If only you have a personal environment (www.outsystems.com/faq/personal-environments/) you can count on the community to help you workaround those issues.
See my remarks on 17 november.
I see a error message if I do things the way you described on 17 november.

Roelof

André Vieira wrote:
Roelof,

What is the issue you are having?
The submit feedback is very important as it help us keep on improving OutSystems Platform fixing the bugs that sneak pass our QA process.
Depending on the license agreement you have you may open support cases to solve your issues (www.outsystems.com/goto/outsystems-support-terms).
Even If only you have a personal environment (www.outsystems.com/faq/personal-environments/) you can count on the community to help you workaround those issues.
 
 

Ok I got it. The error is the same and the workaround João provided works.
You submited feedback (thanks for that) and that means that the error information was sent to us and that the issue will be prioritized and handled accordingly.
oke, I was hoping I get some feedback but now I know that you recieved my info and that is something happen with it so it is oke now.

Roelof

André Vieira wrote:
Ok I got it. The error is the same and the workaround João provided works.
You submited feedback (thanks for that) and that means that the error information was sent to us and that the issue will be prioritized and handled accordingly.
 
 

Hello,
When I create a new order and in that order I add products I get an error because I'm trying to createUpdate an OrderItem before I created the order itself.
I do not want to create the order before adding products so that the user can choose the client and submitDate (mandatory fields in OrderEntity) only in the end.
Is there any obvious solution?
Thanks
Hi Gonçalo,

You can do this in the following way. When you add a product instead of using CreateOrUpdateOrderItem you simply add it to the list of the TableRecords you have on the screen using ListAppend for that. When you it save you will have to cycle (For) all the elements on the table and store them on the database using the CreateOrUpdate.
This is a much more complex logic but a great challenge ;). Remember to think of the scenario where you already stored some products in the database but you are adding/removing some of the products from the order.

Happy coding! :)
What´s the difference between putting the ShippingDetails.Id as an "Order Identifier" or just creating an OrderId attribute inside the ShippingDetails?
Elio Fernandes wrote:
What´s the difference between putting the ShippingDetails.Id as an "Order Identifier" or just creating an OrderId attribute inside the ShippingDetails?
Conceptually they represent different things. On this video we show how to create one to one relationship. For that you set the primary key to be an identifier of the related entity.
Creating another attribute as you propose would result in creating a one to many relationship.
If you want to know more about modeling data and all these relationships you can check out the information on these: I hope those help.
Just a reminder that I've seen often. If your Form has errors:
  • Double check that your aggregate is joining orders and shipping details (Order with or without ShippingDetails)
  • Be sure that your Form Source record is 'GetOrderById.List.Current' and not 'GetOrderById.List.Current.Order'

I want to call my web service in personal environment.
what kind of data type I can use? (like json, xml)
If I can use, how can I handle it?
hyun,

what type of web service are you talking about? The data type depends on the service you trying to reach, for instance if the web service you want to connnect to is a SOAP web service the information is send in XML, if is is a REST API then it is more commonly JSON.
Nonethless in should not have to bother with that on OutSystems Platform side, you just need to know if you are connecting to a SOAP or a REST service.
web service is Rest API  and data type is json.
how can I try to reach in service studio 9.0 application.

André Vieira wrote:
hyun,

what type of web service are you talking about? The data type depends on the service you trying to reach, for instance if the web service you want to connnect to is a SOAP web service the information is send in XML, if is is a REST API then it is more commonly JSON.
Nonethless in should not have to bother with that on OutSystems Platform side, you just need to know if you are connecting to a SOAP or a REST service.