unable to update record data when using excelToRecordList

unable to update record data when using excelToRecordList

  

i am uploading data from excel to update some records, but it is not working, i.e. the data is not updated.

what im doing is to pass the ExcelToRecordList.Current to update table action, any idea why it is not updating?

the update is only for 1 of the columns and update value from 51 to 50, but unable to update to 50..

Hello Linguo,

To update a record, you need the id. Are you providing a valid id?

Also, usually, the structure returned by the excel to record list is not correct and we need to create a local variable of the type of the record we want to create or update, do the assign of each field, probably doing conversions, and than use this as source to the action.

Are you getting any errors?

Cheers

Eduardo Jauch

yes i provided the id and the record has correct value also, there is no error returning, tried to add a commit after the update, do not work.


Hum...

Do the following. Instead of ExcelToRecordList1.Current, set the Update action with ExcelToRecordList1.Current.RATING_MISC

I "think" that I already saw a problem when using the Current instead of the Current.Entity as source...

In any case, if the Update action were having any problem like not finding the record through the ID, you would get an exception.

And if he can find the record, the update should be happening.

Another possibility is that your update could be being overwritten in another part of your code and being set back to the original value...

Cheers,
Eduardo Jauch

Current.Entity is not working.

follow your advice, i created a local variable,  assign value as record is not working, have to assign the value column by column like below.

thank you very much for your help.

I just ran into this issue as well under similar different conditions:

Entity.CreateOrUpdate Widget bound to a Sql Widget that outputs an Entity object.

Note that the Entity object that is the output from the Sql Widget is 98% populated from another AnotherEntity.  The Entity is only supplying the Entity.Id and a secondary attribute used in a left join..

    Select Entity.Id, AnotherEntity.SharedEnityProp1, AnotherEntity.SharedEntityProp2 

    from AnotherEntity 

    left join Entity on Entity.SecondaryId = AnotherEntity.SecondaryId.

Stepping through the routine, the debugger is reporting the output from the CreateOrUpdate as being updated.  However querying the database still shows the old values.

The routine is used loading of an excel resource into an dedicated excel Entity table and then updated the primary Entity from the excel Entity.  The failure to update is on the primary Entity.CreateOrUpdate object. 


erik berg wrote:

I just ran into this issue as well under similar different conditions:

Entity.CreateOrUpdate Widget bound to a Sql Widget that outputs an Entity object.

Note that the Entity object that is the output from the Sql Widget is 98% populated from another AnotherEntity.  The Entity is only supplying the Entity.Id and a secondary attribute used in a left join..

    Select Entity.Id, AnotherEntity.SharedEnityProp1, AnotherEntity.SharedEntityProp2 

    from AnotherEntity 

    left join Entity on Entity.SecondaryId = AnotherEntity.SecondaryId.

Stepping through the routine, the debugger is reporting the output from the CreateOrUpdate as being updated.  However querying the database still shows the old values.

The routine is used loading of an excel resource into an dedicated excel Entity table and then updated the primary Entity from the excel Entity.  The failure to update is on the primary Entity.CreateOrUpdate object. 


This is a bug in OS.  It is occuring in both the Update and CreateOrUpdate Entity actions.  The work around is to create a dummy entity variable and then map each and every attribute manually.  The dummy variable will is property consumed by the Entity update actions.  Just mapping Current to the Dummy variable does not correct the issue.


Hi You,

Have you debugged it? Fail to update can be also caused by any constraint that is attached to that entity and it will throw an exception. If you catch that exception in a function, there will be silent error that you think it will be succeed.

For sure, may be you can attach a .oml sample for that case so it can be investigated by others.

regards,

indra

erik berg wrote:

erik berg wrote:

I just ran into this issue as well under similar different conditions:

Entity.CreateOrUpdate Widget bound to a Sql Widget that outputs an Entity object.

Note that the Entity object that is the output from the Sql Widget is 98% populated from another AnotherEntity.  The Entity is only supplying the Entity.Id and a secondary attribute used in a left join..

    Select Entity.Id, AnotherEntity.SharedEnityProp1, AnotherEntity.SharedEntityProp2 

    from AnotherEntity 

    left join Entity on Entity.SecondaryId = AnotherEntity.SecondaryId.

Stepping through the routine, the debugger is reporting the output from the CreateOrUpdate as being updated.  However querying the database still shows the old values.

The routine is used loading of an excel resource into an dedicated excel Entity table and then updated the primary Entity from the excel Entity.  The failure to update is on the primary Entity.CreateOrUpdate object. 


This is a bug in OS.  It is occuring in both the Update and CreateOrUpdate Entity actions.  The work around is to create a dummy entity variable and then map each and every attribute manually.  The dummy variable will is property consumed by the Entity update actions.  Just mapping Current to the Dummy variable does not correct the issue.


I encountered the same problem. Thank you very much for indicating this is a bug and providing a solution. I already spent quite some time finding the problem and your message really helped me. Assigning every attribute manually indeed solves the problem: