import multiple Excel files and maintain the relationships between these excel files 

import multiple Excel files and maintain the relationships between these excel files 

  
Hi all,
My aim is to migrate an MS Access Database. To do so I have exported several tables into excel. For example I have two files, namely parents (Klanten.xls) and child (Kinderen.xls). As their already is a relationship in place, how can I keep that relationship in place in the outsystems platform?
Is there a way to 'tweek'  for example the ID in the outsystemsplatform and replace it by the Id in the excelfiles?

Regards,

Arnold


Hi Arnold,

Are you importing these Excel files directly as entities in Service Studio, or starting from zero?

If you are importing them as entities, you can right-click your Id attribute and choose the option "Set as Identifier". After that, it's just a matter of deleting the old identifier.

To create the relationship between the Parent and Child entities, assuming you have an attribute in Child named "FatherId", you need to set its Data Type to Parent Identifier.

Regards,
Paulo Ferreira
Hi Paulo,

Thanks for helping me out. It's so simple.....

Regards,
Arnold
Hi Arnold,

I think you'll find someting similar in this online video from our academy.

Cheers,
André
Hi Paulo,

I've done the above for the table Parent (Klant) and Child (Kind). 
By publishing I receive the following messages:
Database Integrity Suggestion
 
Inconsistent database table and entity definitions: column 'OSUSR_zm6_Kind.KINDNUMMER' exists in database, but there is no corresponding attribute in entity 'Kind'.
Database Integrity Suggestion
 
Inconsistent database table and entity definitions: column 'OSUSR_zm6_Klant1.KLANTNUMMER' exists in database, but there is no corresponding attribute in entity 'Klant'.

I don't think it does any harm, but can I get rid of the message some how?

Regards,
Arnold

Hi Arnold,

Those warnings exist because you have deleted an attribute in your entity but the OutSystems Platform doesn't remove the column from the database so that you don't lose the data that it holds. You'll have to go directly to the database, using SQL Server Management Studo for instance, to remove it if it is not necessary.

Cheers,
André
Another problem I'm facing is that I have set the KlantId at the table Child (Kind) as Klantidentifier. 
It then shows the following 2 error messages:
Invalid Data Type
 
'Text, Integer, Decimal, Date Time, Date, Time, Phone Number, Email or Currency' data type required instead of 'Klant Identifier'.

and

Invalid Data Type
 
'Klant Identifier' data type required instead of 'Integer'.
-> this error refers to the edit form of the the Child(Kind), the combo/listbox requires a 'KlantIdentifier'.

As soon as I change the KlantId into 'Integer' I the error messages disappear.

Regards,
Arnold 

I made a mistake in the explanation.

Error message: 
'Text, Integer, Decimal, Date Time, Date, Time, Phone Number, Email or Currency' data type required instead of 'Klant Identifier'.
-> refers to the edit form of the Child(Kind) at the combo/listbox of the KlantId.

Error message:
'Klant Identifier' data type required instead of 'Integer'.
-> seems to refer to the conversion of the excel file:
ConvertFromExcel.Current.Excel_Kinderen.KlantId
Regards,
Arnold

Hi Arnold,

To address that error you can use the built-in function IntegerToEntityRefInteger (help here) to convert the integers from the Excel file in entity identifiers. You must use this to let Service Studio know that you are not using an Integer as a KlantId by mistake.

The expression in the assign node should look like follows:
IntegerToEntityRefInteger(ConvertFromExcel.Current.Excel_Kinderen.KlantId)
Regards,
Paulo
Thx!
One error I have resolved with the solution you mentioned.

However I don't know how to solve this one:
Error message: 
'Text, Integer, Decimal, Date Time, Date, Time, Phone Number, Email or Currency' data type required instead of 'Klant Identifier'.
-> refers to the edit form of the Child(Kind) at the combo/listbox of the KlantId.
-> the variable: KindEdit.Record.Kind.KlantId has to be changed (I believe).

Regards,
Arnold

Without knowing the eSpace, I'm unable pinpoint the solution. Can you attach it (or part of it)?

If you create an EditRecord from scratch (drag to the canvas) and then drag the Kind entity on top of it, do you still get a form with errors? It might be worth the shot to compare it to what you have now.

Regards,
Paulo
Hi Paulo,

I've attacehd the eSpace. Thanks for taking a look at it.

Regards,
Arnold
You mentioned a combo box, but it seems you are using a text input. Is the combo box your goal?

If it is, you can achieve it by replacing the Input by a Combo Box and then fill the Source Entity property with Klant and the Variable with KindEdit.Record.Kind.KlantId.

Regards,
Paulo
Thx!
Paulo, Indeed the combo box was the goal. The text input had been used when I automatically created the 'Edit Kind'. 
I managed to replace that by the combobox, but I wasn't able to change the Source Entity/Structure with Klant. Only Kind was available. And that  (mostlikely) gave me an error publishing it.

Regards
Arnold

p.s
I'm sorry to take so much of your time, but I'm new at this...
Don't worry, soon you'll get past these initial road blocks.

What prevented you from changing the Source Entity to Klant? When I open the eSpace here, it appears in the list of options, along with several other entities.

Regards,
Paulo
Hi Paulo,

I Succeeded when I deleted the list/combo box that was already in place and created a new combobox from scratch. Then indeed I got more options, also Klant. And then I received the green light to publish.

However, when I tried to publish I received the following message:

Publishing Error
Unable to upgrade database schema. Error trying to create foreign key on database field 'OSUSR_zm6_Kind.KLANTID'.
Exception: The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_zm6_Kind_OSUSR_ZM6_KLANT1_KLANTID". The conflict occurred in database "outsystems", table "dbo.OSUSR_ZM6_KLANT1", column 'ID'.

As Andre mentioned earlier, I probably have to delete these Items in the database. Unfortunately I don't know with what tool to reach the database. (if that indeed is the solution of course). I already tried Service Center...

Regards,
Arnold
 
I'm assuming you are using the Community edition with the default database (SQL Server), is that the case?

If it is, and you are confortable with SQL, you can use the default command line utility sqlcmd (which is installed with the database) by starting it with sqlcmd -S localhost\OUTSYSTEMS -d outsystems. Maybe someone else can point you to a better tool that is easily accessible.

Once you have access, the simplest way would be to drop the Kind (osusr_zm6_Kind) and Klant (osusr_zm6_Klant) tables and just republish the eSpace. Now, I'm only suggesting this because you are just starting the application and all your relevant data is still "backed-up" in the Excel files.

Alternatively, under the same assumption, a simple way to just get it working is to clone the eSpace (eSpace -> Clone... menu in Service Studio) and use the newly created clone. When you publish the clone, your entities will be associated to different database tables, getting a fresh start.

Regards,
Paulo
Thx Paulo,

Using the Clone solution I was able to publish the database. However for some reason Kind_List shows no records. To be sure I have also deleted the combobox KlantId, but no results there either.

Regards,
Arnold
Hi Arnold,

Unfortunately bootstraping data with relationships can be tricky some times...
You have two entities, Kind and Klant. I will attach an eSpace as the result of the following steps:
  1. Create the Klant entity by importing the Klanten.xsl file
  2. Create the Kind entity by importing the Kinderen.xsl file
  3. Change the type of KlantId to Klant Identifier and I get an error in the BootstrapKinds action.
    The Id attribute of the entities is an auto-number attribute and as so, even if you change the bootstrap to fill it with the kindnummer it will be overriden. So we need something different.
  4. Go to the BootstrapKinds action. We have a dependency for the klants so this means that we need to have them bootstrapped before we bootstrap the klants. You have probably seen this in the video I mentioned...
    Add the BootstrapKlants action in the begining of the flow right after the start node.
  5. Before the assign in the cycle we need to query for the klant using the klantnummer that on the excel is the klantid column.
  6. On the assign for the KlantId attribute that is in error change the respective value to use the output of this new query.
  7. Now we actually don't need the kindnummer attribute in the Kind entity so you can remove it.
  8. After you publish (and only now you should publish it) and the data is bootstrapped you can also remove the klantnummer attribute from the Klant entity. The next time you publish you'll get one of those warnings about a column existing in the database but no corresponding attribute existing in the entity.
  9. Now you can start creating your screens...

I hope this helps you get unstuck. If you're trying these steps be sure to start from scratch.

Cheers,
André

Hello Arnold, 

I think André's answer is just what you need to get started, so I'll just try to shed a little light on why Kind_List shows no records in the first approach.

In the eSpace you attached, both Klant's and Kind's data were bootstrapped in separate timers, which are set to run after you publish. If I were to guess a cause, I'd risk that the timer for Kind ran first than the timer for Klant. Since the Kind table depends on data from the Klant table (which was still empty), the inserts trigger an error.

If this was the case (or other possible causes), the first step would be to check Service Center's error logs (Monitoring tab).

Regards,
Paulo
Hi Eric and Paulo,

Thanks for the input. I'll have a look at it and let you know.

Eric,
At this moment I'm developing an application and at the same time get acqainted with Outsystems. To do so I would like to import some tables (excel files), for which I can use the method you mentioned above.
After a while when the application is ready for production I would like to upload/update the same excel files again, but then ofcourse whith the latest data. Can I then also use this method?

p.s I expect to have around 10 tables/excelfiels for which approximately 7 will be updated. The remainder are rather static.


Regards,
Arnold
Hi Arnold,

You'll need to change it a lit bit. This bootstrap method is using the excel file stored as a resource and it is implemented to Create records not update them.
But the logic for the update is not that much different what you'll need to do is first get the record from the database and then update its attributes with the data from the excel file. You need to use a file input to upload the excel file.

I've updated the sample with that logic, I hope it helps.

Cheers,
André
HI Andre,

Thanks for the info. I got it working. Now I'll try to do it with multiple files.
ONE OTHER IMPORTANT QUESTION:
The file with all the Klant data; I would like to remove it from the site!
I don't want the clients to see their information on the internet.
Can you arrange that?

Thanks in advance.

Regards,
Arnold
Hi Arnold.

Glad I could help you.
I've deleted the information you requested.

Cheers,
André
Thx Andre!

Arnold
Hi all,

I succeeded in maintaining the relationships for 2 excel files. I even managed to do so for 10 files.
Ofcourse I got a problem, namely that not all forms/screens were shown when published. Therefore I set up a new application and (if I am correct) I set it up in the same way as the previous application. And for some reason I got a Database error in the latest application (ZAP5). To be sure that I haven't made a misstake I've set up ZAP5 twice. Both with the same result.
Can anyone put me in the right direction?

If you would like to see the application that didn't give a database error, please let me know and I'll attach it.

Regards,
Arnold Grippeling

Edited by André Vieira on request of user to remove attachment.
Hi Arnold,

I took a look at your eSpace and it seems to me that you understood correctly how to modify the bootstrap actions to apropriately re-establish the relations among the records. However there is no effort to ensure that the data is imported in the correct order. For example: before you run BootstrapVerwijsbriefs you should have run BootstrapKinds, otherwise the kinds will not be properly assigned. BootstrapKinds in kind should be run after BootstrapKlants, etc.

In ServiceStudio, if you go to the Processes tab you'll find the timers that run those actions: they're all set to run when published and can run at any order. Probably you should leave a single timer that runs an action that runs all the bootstrap actions in the proper order.
Thanks for the reply, I thought that was the case. 
In this version I've tried to do so, meaning that all bootstraps come together in bootstrap Verwijsbrief.
This means that within bootstrap Verwijsbrief I have also set bootstrap Kind in the right order. I have included bootstrap Tarief into bootstrap Kind.

Then again I still received a database error:
Publishing Error
 
Unable to upgrade database schema. Error trying to create foreign key on database field 'OSUSR_a94_Kind1.KLANTID'.
Exception: The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_a94_Kind1_OSUSR_A94_KLANT1_KLANTID". The conflict occurred in database "outsystems", table "dbo.OSUSR_A94_KLANT1", column 'ID'.
SQL: ALTER TABLE "OUTSYSTEMS"."DBO"."OSUSR_A94_KIND1" ADD CONSTRAINT OSFRK_OSUSR_a94_Kind1_OSUSR_A94_KLANT1_KLANTID
FOREIGN KEY ("KLANTID") REFERENCES "OUTSYSTEMS"."DBO"."OSUSR_A94_KLANT1" ("ID");
 
 
Exception Details:
[1] Publishing Error: Unable to upgrade database schema. Error trying to create foreign key on database field 'OSUSR_a94_Kind1.KLANTID'.
Exception: The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_a94_Kind1_OSUSR_A94_KLANT1_KLANTID". The conflict occurred in database "outsystems", table "dbo.OSUSR_A94_KLANT1", column 'ID'.
SQL: ALTER TABLE "OUTSYSTEMS"."DBO"."OSUSR_A94_KIND1" ADD CONSTRAINT OSFRK_OSUSR_a94_Kind1_OSUSR_A94_KLANT1_KLANTID
FOREIGN KEY ("KLANTID") REFERENCES "OUTSYSTEMS"."DBO"."OSUSR_A94_KLANT1" ("ID");
 
bij #YUd.#f3.#zYd(HEMessageArrayList warnings, IDbTransaction adminTrans, Dictionary`2 schemaTransactions, String fullQuery, Int32 updateDBTimeout)
   bij #YUd.#f3.#yYd(String eSpaceName, HEMessageArrayList warnings, Int32 eSpaceVersionId, DeployPhase phase, String uniqueId)
   bij #YUd.#f3.#mYd(String eSpaceName, Int32 eSpaceVersionId, String uniqueId, String username, DeployPhase phase)
   bij #YUd.#f3.#mYd(ICompilerContext context, String eSpaceName, Int32 eSpaceVersionId, String uniqueId, String username, DeployPhase phase)
   bij System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   bij System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
   bij System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(IMessage reqMsg)
   bij System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(IMessage reqMsg)
   bij System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(Object[] args)
   bij System.Runtime.Remoting.Channels.ChannelServices.DispatchMessage(IServerChannelSinkStack sinkStack, IMessage msg, IMessage& replyMsg)
   bij System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
   bij #YUd.#f3.#d0d.#a0d(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
   bij System.Runtime.Remoting.Channels.Tcp.TcpServerTransportSink.ServiceRequest(Object state)
   bij System.Runtime.Remoting.Channels.SocketHandler.ProcessRequestNow()
   bij System.Runtime.Remoting.Channels.SocketHandler.BeginReadMessageCallback(IAsyncResult ar)
   bij System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   bij System.Threading.ExecutionContext.runTryCode(Object userData)
   bij System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   bij System.Net.ContextAwareResult.Complete(IntPtr userToken)
   bij System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   bij System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   bij System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
[2] System.Data.SqlClient.SqlException: The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_a94_Kind1_OSUSR_A94_KLANT1_KLANTID". The conflict occurred in database "outsystems", table "dbo.OSUSR_A94_KLANT1", column 'ID'.
   bij OutSystems.HubEdition.RuntimePlatform.DBHelper.#Wab(DbException e, IDbTransaction trans)
   bij OutSystems.HubEdition.RuntimePlatform.DBHelper.ExecuteNonQueryDontCleanParameters(IDbCommand cmd, String description, Boolean isApplication, Boolean skipLog)
   bij OutSystems.HubEdition.RuntimePlatform.DBHelper.ExecuteNonQuery(IDbCommand cmd)
   bij OutSystems.HubEdition.DeploymentController.DBCompilerService.ExecuteInlineStatementWithTimeout(IDbTransaction tran, String statement, Int32 timeout)
   bij #YUd.#f3.#zYd(HEMessageArrayList warnings, IDbTransaction adminTrans, Dictionary`2 schemaTransactions, String fullQuery, Int32 updateDBTimeout)

And I've done this in an earler version ZAP4 and then it was oke (except that some screens were empty), but for some reason I now get this error message every time I publish (even if I set it up a new application I get the same error). I assume that  I first have to solve this error before I can create the list_screens.
Do you know why this error occurs?

Regards,
Arnold

Edited by André Vieira on request of user to remove attachment.
In this version I don't get the database error mentioned above.

Regards,
Arnold

Edited by André Vieira on request of user to remove attachment.
Hi All,

I've fixed the database error. How? Well, I now have imported and bootstrapped every single excel file and then published it. So aftter aprox. ten times publishing the application it all works; no Database error. Actually, I don't know the difference when importing and bootstrapping all the excelfiles in one sequence, but it works. And that matters!!
Now the next challenge! Did I manage to bootstrap all the files in the right sequence in order to get all the screens filled?
Hi There,

I've got all the screens working except for the Verwijsbrief. If I do a test in the bootstrap 'Get Verwijsbrief' then I don't get any testresults. I assume that in the excel file there is some data (for example: ? Bullets) that prevents it from getting the results.
1) Is this a correct assumption?
2) If so, is there a way available that it ignores the 'strange' data?

Regards,
Arnold
I've done some tests and in the attached excel sheet, you'll find the columns that don't return any data.

Regards,
Arnold
Hi Arnold,

I tried importing that excel using the ServiceStudio automatically generated code, but no records were imported like it happened to you.
In order to troubleshoot this issue, I went to ServiceCenter where I got to MonitoringErrors and identified that in my case the bootstrap timer was failing to run because the entity attributes' length was set to 2000 but apparently some of the excel's contents are larger than that. In these cases, the database throws an error stating that the content would be truncated.

Increasing the length of these entity attributes should therefore solve the problem.
Thanks for this input. I'll take a look at that.
In the mean time  I  tried to go along (but then without the columns I mentioned earlier) and for some reason I get a database error. In my opinion it sometimes it doesn't show me this database error and sometimes it does.
If I publish the document attached I receive this error:

Publishing Error
 
Unable to upgrade database schema. Error trying to create foreign key on database field 'OSUSR_684_Kind2.KLANTID'.
Exception: The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_684_Kind2_OSUSR_684_KLANT2_KLANTID". The conflict occurred in database "outsystems", table "dbo.OSUSR_684_KLANT2", column 'ID'.
SQL: ALTER TABLE "OUTSYSTEMS"."DBO"."OSUSR_684_KIND2" ADD CONSTRAINT OSFRK_OSUSR_684_Kind2_OSUSR_684_KLANT2_KLANTID
FOREIGN KEY ("KLANTID") REFERENCES "OUTSYSTEMS"."DBO"."OSUSR_684_KLANT2" ("ID");
 
 
Exception Details:
[1] Publishing Error: Unable to upgrade database schema. Error trying to create foreign key on database field 'OSUSR_684_Kind2.KLANTID'.
Exception: The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_684_Kind2_OSUSR_684_KLANT2_KLANTID". The conflict occurred in database "outsystems", table "dbo.OSUSR_684_KLANT2", column 'ID'.
SQL: ALTER TABLE "OUTSYSTEMS"."DBO"."OSUSR_684_KIND2" ADD CONSTRAINT OSFRK_OSUSR_684_Kind2_OSUSR_684_KLANT2_KLANTID
FOREIGN KEY ("KLANTID") REFERENCES "OUTSYSTEMS"."DBO"."OSUSR_684_KLANT2" ("ID");
 
bij #ZUd.#f3.#AYd(HEMessageArrayList warnings, IDbTransaction adminTrans, Dictionary`2 schemaTransactions, String fullQuery, Int32 updateDBTimeout)
   bij #ZUd.#f3.#zYd(String eSpaceName, HEMessageArrayList warnings, Int32 eSpaceVersionId, DeployPhase phase, String uniqueId)
   bij #ZUd.#f3.#nYd(String eSpaceName, Int32 eSpaceVersionId, String uniqueId, String username, DeployPhase phase)
   bij #ZUd.#f3.#nYd(ICompilerContext context, String eSpaceName, Int32 eSpaceVersionId, String uniqueId, String username, DeployPhase phase)
   bij System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   bij System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
   bij System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(IMessage reqMsg)
   bij System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(IMessage reqMsg)
   bij System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(Object[] args)
   bij System.Runtime.Remoting.Channels.ChannelServices.DispatchMessage(IServerChannelSinkStack sinkStack, IMessage msg, IMessage& replyMsg)
   bij System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
   bij #ZUd.#f3.#e0d.#b0d(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
   bij System.Runtime.Remoting.Channels.Tcp.TcpServerTransportSink.ServiceRequest(Object state)
   bij System.Runtime.Remoting.Channels.SocketHandler.ProcessRequestNow()
   bij System.Runtime.Remoting.Channels.SocketHandler.BeginReadMessageCallback(IAsyncResult ar)
   bij System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   bij System.Threading.ExecutionContext.runTryCode(Object userData)
   bij System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   bij System.Net.ContextAwareResult.Complete(IntPtr userToken)
   bij System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   bij System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   bij System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
[2] System.Data.SqlClient.SqlException: The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_684_Kind2_OSUSR_684_KLANT2_KLANTID". The conflict occurred in database "outsystems", table "dbo.OSUSR_684_KLANT2", column 'ID'.
   bij OutSystems.HubEdition.RuntimePlatform.DBHelper.#Wab(DbException e, IDbTransaction trans)
   bij OutSystems.HubEdition.RuntimePlatform.DBHelper.ExecuteNonQueryDontCleanParameters(IDbCommand cmd, String description, Boolean isApplication, Boolean skipLog)
   bij OutSystems.HubEdition.RuntimePlatform.DBHelper.ExecuteNonQuery(IDbCommand cmd)
   bij OutSystems.HubEdition.DeploymentController.DBCompilerService.ExecuteInlineStatementWithTimeout(IDbTransaction tran, String statement, Int32 timeout)
   bij #ZUd.#f3.#AYd(HEMessageArrayList warnings, IDbTransaction adminTrans, Dictionary`2 schemaTransactions, String fullQuery, Int32 updateDBTimeout)

Can anyone explain to me why this happens (or that somehow I do something different and therefore wrong)?

Regards,
Arnold

Edited by André Vieira on request of user to remove attachment.
Hi Arnold,

what I can understand from that error is that you already published your eSpace with a definition of the Klint entity without the foreign key to the Klant entity. Now when you're trying to publish this change you get this error because it is violating the constraint, meaning that you have values in the KlantId column that don't exist in th Klant entity. This really hasn't to do with which version of the application you publish. These constraints exist in a relational database to guarantee the integrity of data, in other words, to guarantee that these relationships aren't broken.

You have two choices now:
  • probably the hardest one is to go the database directly and clean the tables so that your bootstrap runs again and creates the proper relationships
  • the easiest would be to clone the eSpace and publish it again

I hope this helps you.
Cheers,
Andreé
Great!

That did the trick ans all screens are in place! I'm now getting the chance to develop all the screens, I can't wait....
A question I have is, how do I 'start' the cloned version at the 'Applications at localhost' it isn't mentioined there?

Regards,
Arnold
You'll probably find the eSpace module under the Independent Modules. What you have to do is move it to your application and set it as the frontoffice or create a new application and move this module there.

Cheers,
André
Thx! 
That was indeed the case.

Regards,
Arnold
Hi,
How to save data from excel to OS database if in the 
excel it contains more than 20 entities or records.
Can anyone explain me how to implement it.
Regards,
ChandrasekarRadhakrishnan