Update xpage field from serverside script?

I have a server side script, that i run and it sets the approver1 value, i then want to take that value and set the value of a field on the xpage which is tied to a data form. How do i do this, i have tried this

var1 = dominoDocument1.getDocument()

var1.replaceItemValue(‘projectmgr’, approver1)

and this

dominoDocument1.replaceItemValue(‘projectmgr’,approver1)

any suggestions?

Subject: no i was trying to update the ui without a save

they put in the job code and cost and this returns the approvers, do i need to save? Can this be done on the front end? or would that have to be client side script?

Subject: You are correct, I was referring to the backend class

You could just set the value with the datasource in your second example and it should be served up when it makes the round trip.

I believe the backend requires a save, but not 100% sure in this scenario.

Subject: Do you perform a var1.save()?

Hi Mark,

Your approach looks correct. Do you perform a save() after you set the value?

John

Subject: Sorry had trouble somewhere else in my script

dominoDocument1.replaceItemValue works just fine,

very hard to debug serverside script, i can figure out which line is causing the error, that is the extent of what i can figure out.

Subject: can you post the line of code?