Question

Update SmartObject without value for required field.

  • 14 January 2024
  • 3 replies
  • 56 views

Userlevel 1
Badge +1

Hello everyone,

 

I need to Update recorded value based on serviceID field, but I got the Error message that the ID field is required.

There’s any way to pass this error?

Since the ID field is weak entity and I really don’t need it, but I have to keep some field as a primary key to be able to use the create and update methods. 

 

 


3 replies

Badge +8

Hi @Demah , When the SMO is created K2 will detect the Primary key on the table and then make that required for the Update and Delete methods. 

When you edit the SMO, you will not be able to change these. 

Is there a reason why you would not use ServiceID as your primary key?

 

 

Userlevel 1
Badge +1

Hi @Demah , When the SMO is created K2 will detect the Primary key on the table and then make that required for the Update and Delete methods. 

When you edit the SMO, you will not be able to change these. 

Is there a reason why you would not use ServiceID as your primary key?

 

 

Thank you, Deon, for your replay!

I solve it by setting (ServiceID & RelatedDeptID) as key of the table and discarded ID column.

the reason of I don't use ServiceID as your primary key, because the ServiceID alone is not unique in my case.

Userlevel 2
Badge +4

When ever you are creating the smartobject please dont tick mark as its required by you as its a autonumber so dont do this after doing this your problem will be solved few days back was also receiving the same error

 

Reply