locked
How do you commit changes made in HTML screen, when defaults provided at the entity level? RRS feed

  • Question

  • Hi,

    I have an application where I am defaulting the initial values for an HTML screen at the entity level, using the following code at the entity level:

     msls.promiseOperation(CallGetUserRecordNumber).then(function PromiseSuccess(Result) {
            myapp.activeDataWorkspace.ApplicationData.ADInformations_SingleOrDefault(Result).execute().then(function (result2) {
    
                entity.RequestorFirstName = result2.results[0].givenName;
                entity.RequestorLastName = result2.results[0].sn
                entity.RequestorEmail = result2.results[0].mail
                entity.RequestorPhone = result2.results[0].telephoneNumber
        })
    

    That works exactly as I intend it to. When the html page opens up the defaulted values are there. BUT ....

    If BEFORE I commit the screen to save, I change one of those default field values to some other value on the screen and then hit the save button- it commits the defaulted value from the entity level instead. IF I then go into the record and html screen again and make a change to that NOW existing record and make a change to one of the originally defaulted values and save it- it does finally commit the change.

    Why does it not commit the screen changes on the first save, but does on the second save? Generally when one has 'defaults' it means that you want some initial values- but you may want to still change them to something else before the initial save. IF that is normal HTML screen behavior- how do you code around this?

    Thanks

    Wednesday, August 28, 2013 3:41 PM

Answers

  • Update: Developer error   :(

    I had coded some defaults to go in at the entity_inserting code level that overwrote what I was doing on entry screen.

    Answered my own question

    Sorry folks

    • Marked as answer by lvsund Tuesday, September 3, 2013 2:24 AM
    Tuesday, September 3, 2013 2:24 AM