Combo-box

  

without combo-box we cant insert value for foreign key attribute through outsystems?.


1. I have two tables , one table is related to another table . I have inserted value to parent table and then try to insert value to child table . In outsystems for foreign key default it shows combo-box but i dont want combo-box because i want to input that . but i could not able to find the option . Please help me in this.


Thanks

Janarthanan

Hello Janarthanan

Not sure about your scenario.

Do you have entity A and than, entity B with a foreign key to entity A? 

You can pass the Id of entity A to the page where you're editing entity B (through input parameter) and using an assign set the value directly onto the record before the CreateOrUpdate action.

If the child entity is in the same page, just save first the entity A and than use its identifier, returned by the CreateOrUpdate action as the value to the foreign key of entity B.

If you really want to SELECT the value, the best way is the combo box. If you want to use an input (why????), or you type directly the identifier, or you will have to do a lookup and find the Id using other field (typed in the input), and than use the identifier found.

Cheers


Eduardo Jauch wrote:

Hello Janarthanan

Not sure about your scenario.

Do you have entity A and than, entity B with a foreign key to entity A? 

You can pass the Id of entity A to the page where you're editing entity B (through input parameter) and using an assign set the value directly onto the record before the CreateOrUpdate action.

If the child entity is in the same page, just save first the entity A and than use its identifier, returned by the CreateOrUpdate action as the value to the foreign key of entity B.

If you really want to SELECT the value, the best way is the combo box. If you want to use an input (why????), or you type directly the identifier, or you will have to do a lookup and find the Id using other field (typed in the input), and than use the identifier found.

Cheers


Thanks
Eduardo


PFA sample application. In that application company(separate screen) has "name " attribute and it has been used as foreign key (companyId) in contact details (separate screen) . When I use edit record (dragged Contact model to edit record) for foreign key it come with combo-box but I want it should be input field(many names can be there  but I want to use mine without combo box) . I have tried a lot but could not able to get in my way.


If the company identifier is of Text type, in the Contact screen replace the combo box with an input and set the variable to the correct attribute of the form and you're done.

I would still use a combo box with a Select2, Or an Input box with the Input Auto complete widget.

Cheers


Eduardo Jauch wrote:

If the company identifier is of Text type, in the Contact screen replace the combo box with an input and set the variable to the correct attribute of the form and you're done.

I would still use a combo box with a Select2, Or an Input box with the Input Auto complete widget.

Cheers


Thanks . If I change  company identifier as text type then contact looses integrity with company . I want relationship should be there when inserting data.


Hello

You're not making sense. A foreign key, in OutSystems, must be an identifier. If the Name of company is not the Primary key of the entity, than, or your "foreign key" in the Contact is just a text field, or the foreign key is the Company Identifier, not the name...

In the last case, that is what makes sense to me, and seems to be the case here, why not simply use a combo box with a select2, if you're using a SilkUi template, that will enable auto compete, or if you're using London, hust use the RichWdget Input Autocomplete in an input.

This will provide a better UI for the user and he will still type/select the company's name.

Cheers

Janarthanan Govindaraj


Your test app is not very clear. The Eduardo sugestion for me is a good sugestion, but after see you test app I not so sure about what you pretend


Best Regards