Creating an error in a sail interface but it is not showing in server-logs

 a!dynamicLink(
            value: 1,
            saveInto: {
              a!writeToMultipleDataStoreEntities(
                valuesToStore: {
                  a!entityData(
                    entity: cons!ENTITY,
                    data: {
                      'type!{urn:com:url}Entity'(
                        ID: 5
                      )
                    }
                  )
                },
                onSuccess: {
                  a!save(
                    local!step,
                    1
                  )
                },
                onError: {
                  a!save(
                    local!error,
                    "An error has occured while saving. Please try again or email getHelp."
                  )
                }
              )
            }
          )
Hello everyone, 

 

We are trying to do a record link to save data into the database but we want to have some way to support the user if the save fails for some reason.  When we are mocking the case where bad data is input, we are getting an error notice but it is not putting an entry in the server-logs.  we figured that when it errors it would write into the server-logs but it is not.  Anyone have any ideas on how we could do logging other than a generic error message showing to the user?

 

In the interface designer we are getting this error message before showing the error message on the usual interface  but this is not showing in the server logs:

Could not display interface. Please check definition and inputs.

Interface Definition: Expression evaluation error: An error occurred while executing a smart service: An error occurred while trying to write to the data store [Transactional]. No values have been written. Details: not-null property references a null or transient value:Entity.typeID (APNX-1-4208-004) This error will not be displayed to the user viewing this form. Click here to dismiss the error message and see the resulting interface.

 

 

Thanks,

Seth

 

Code we are using: 

 a!dynamicLink(
            value: 1,
            saveInto: {
              a!writeToMultipleDataStoreEntities(
                valuesToStore: {
                  a!entityData(
                    entity: cons!ENTITY,
                    data: {
                      'type!{urn:com:url}Entity'(
                        ID: 5
                      )
                    }
                  )
                },
                onSuccess: {
                  a!save(
                    local!step,
                    1
                  )
                },
                onError: {
                  a!save(
                    local!error,
                    "An error has occured while saving. Please try again or email getITHelp."
                  )
                }
              )
            }
          )

  Discussion posts and replies are publicly visible

Parents
  • HI,

    If you are using cloud environment please check your jboss1-stdOut.log.yyyy.mm.dd file for the error log. I think in DB you may not have define the primary key as auto increment (Since you are setting a value for the id)  in this case you will have to set a default value for the primary key. Other wise you will get the above error. Hope this helps.

     

    I have tested this by my self and observed the same behavior as yours. if primary key is not auto increment then set a default value in DB table. This will resolve your issue.

    Regards
    Suresh

Reply
  • HI,

    If you are using cloud environment please check your jboss1-stdOut.log.yyyy.mm.dd file for the error log. I think in DB you may not have define the primary key as auto increment (Since you are setting a value for the id)  in this case you will have to set a default value for the primary key. Other wise you will get the above error. Hope this helps.

     

    I have tested this by my self and observed the same behavior as yours. if primary key is not auto increment then set a default value in DB table. This will resolve your issue.

    Regards
    Suresh

Children