Different between dosave and dosavenow in peoplecode
Different between dosave and dosavenow in peoplecode function of peoplesoft.
Dosave =
For example 1 PeopleCode:
PeopleCode Statment 1
PeopleCode Statment 2
Dosave() / Dovenow()
PeopleCode Statment 3
In case of Dosave function PeopleCode Statment 1 to PeopleCode Statment 2 will execute then save processing will trigger and DoSave can be used only in FieldEdit, FieldChange, or MenuItemSelected PeopleCode.
And in case of DosaveNow function PeopleCode Statment to PeopleCode Statment 2 will execute then save processing will trigger and rest PeopleCode Statment 3 will execute after save. Save processing (including SaveEdit, SavePreChange, SavePostChange, and Workflow PeopleCode)
More Detail
Do savenow()–>save the current field/component immediately..
Example 2: in the main page having some fields
1. emplid
2. status
3. rccode
4. deptid
…etc
when you are enter first field value as 100 and immediately tab out of that field, 100 value saved in database. when you are writing dosavenow() function in field edit event.
do save() —> save the current component..just like clicking on save button…
Example 3: when you enter all field values in the page finally click on save button, that time only those values saved in database.
When you use save button instead save of component then peoplecode both set component changed and do save in field change event.
setcomponetchanged();
dosave ();
Ref: https://it.toolbox.com/question/dosave-and-dosavenow-090607
Ref: https://docs.oracle.com/cd/E13292_01/pt849pbr0/eng/psbooks/tpcl/chapter.htm?File=tpcl/htm/tpcl02.htm
Ref: http://www.compshack.com/forum/peoplesoft/peoplesoft-technical/difference-between-do-save-and-do-save-now-functions-peoplecod