Change data type of the import excel resources to Identifier

Change data type of the import excel resources to Identifier

  

it is possible to change the import excel resource data type, for example integer to Identifier? what I want to do is to have connection many-to-one (project entity & customer entity). so in the excel resource for project , it already have the CustomerId. I change the CustomerId entity attribute's data type from  integer to Customer Identifier. But when I try to publish there's an update error.


I used the same method to change other entity attribute in the project entity to Identifier like ProjectManagementId to ProjectUser identofier (ProjectUser is an Entity) & ProjectStatuId to StatusProject Identifier  (StatusProject is a Static Entity) and the publish is successful. i check back the data and it was fine. But when i want to change the CustomerId this problem happen. i try delete and import back the excel resource and sometime this happen to the other entity atribute (ProjectManagementId to ProjectUser identofier & ProjectStatuId to StatusProject Identifier)

can someone explain about this,

Thank you.


Solution

Taufiq Hamdan wrote:

it is possible to change the import excel resource data type, for example integer to Identifier? what I want to do is to have connection many-to-one (project entity & customer entity). so in the excel resource for project , it already have the CustomerId. I change the CustomerId entity attribute's data type from  integer to Customer Identifier. But when I try to publish there's an update error.


I used the same method to change other entity attribute in the project entity to Identifier like ProjectManagementId to ProjectUser identofier (ProjectUser is an Entity) & ProjectStatuId to StatusProject Identifier  (StatusProject is a Static Entity) and the publish is successful. i check back the data and it was fine. But when i want to change the CustomerId this problem happen. i try delete and import back the excel resource and sometime this happen to the other entity atribute (ProjectManagementId to ProjectUser identofier & ProjectStatuId to StatusProject Identifier)

can someone explain about this,

Thank you.


AsslamuAlaikum,

Looks like the customerId value which you are assigning to Project is not present in Customer Entity, kindly check. If it is present and still you are facing the same issue then you can use

SyntaxEditor Code Snippet

IntegerToIdentifier()

 for conversion.


Thanks,

Afaque

Solution

Afaque Shaikh wrote:

Taufiq Hamdan wrote:

it is possible to change the import excel resource data type, for example integer to Identifier? what I want to do is to have connection many-to-one (project entity & customer entity). so in the excel resource for project , it already have the CustomerId. I change the CustomerId entity attribute's data type from  integer to Customer Identifier. But when I try to publish there's an update error.


I used the same method to change other entity attribute in the project entity to Identifier like ProjectManagementId to ProjectUser identofier (ProjectUser is an Entity) & ProjectStatuId to StatusProject Identifier  (StatusProject is a Static Entity) and the publish is successful. i check back the data and it was fine. But when i want to change the CustomerId this problem happen. i try delete and import back the excel resource and sometime this happen to the other entity atribute (ProjectManagementId to ProjectUser identofier & ProjectStatuId to StatusProject Identifier)

can someone explain about this,

Thank you.


AsslamuAlaikum,

Looks like the customerId value which you are assigning to Project is not present in Customer Entity, kindly check. If it is present and still you are facing the same issue then you can use

SyntaxEditor Code Snippet

IntegerToIdentifier()

 for conversion.


Thanks,

Afaque

Waalaikumusalam (^_^).

Thank you Afaque Shaikh, for replied.

Alhamdulillah,Its worked! But I still don't understand how is happen. Why other entity attributes (ProjectManagementId to ProjectUser identofier & ProjectStatuId to StatusProject Identifier) , don't need to convert to identifier?

can you explain about that?

Thank you.

Hello Taufiq,

When you change an attribute from integer to an Entity Identifier, you may have problems in the following situations, if there are data already present in the entity:

1. There are values in the attribute defined as 0 (or any other value not found in Customer entity). When the system converts the data from Integer to Customer Identifier (when you publish after changing the attribbute data type), the database will try to find the corresponding line in the Customer entity, but it will not find any line with id 0  or a value that is not there, and will rise an error.  

2. You are defining a DELETE rule set to DELETE on this attribute and there is another foreign key in the other entity (Customer) pointing to this entity (Project) that also has a DELETE rule set to DELETE. This will create a circular delete problem that the database will not be able to handle.

I would say that you have the first problem. So, you can't create a record with a value for CustomerId that is not present in the Customer entity. And ZERO will only be accepted if on creation the field is already a Customer Identifier and the mandatory is set to NO.

Cheers.

Eduardo Jauch wrote:

Hello Taufiq,

When you change an attribute from integer to an Entity Identifier, you may have problems in the following situations, if there are data already present in the entity:

1. There are values in the attribute defined as 0 (or any other value not found in Customer entity). When the system converts the data from Integer to Customer Identifier (when you publish after changing the attribbute data type), the database will try to find the corresponding line in the Customer entity, but it will not find any line with id 0  or a value that is not there, and will rise an error.  

2. You are defining a DELETE rule set to DELETE on this attribute and there is another foreign key in the other entity (Customer) pointing to this entity (Project) that also has a DELETE rule set to DELETE. This will create a circular delete problem that the database will not be able to handle.

I would say that you have the first problem. So, you can't create a record with a value for CustomerId that is not present in the Customer entity. And ZERO will only be accepted if on creation the field is already a Customer Identifier and the mandatory is set to NO.

Cheers.

Thank you Eduardo Jauch for the explanation.