Expand my Community achievements bar.

SOLVED

Save As

Avatar

Level 9

My scrpt should make a subform visible and then run Save As. No matter what i do, it runs the Save As first. What am I doing wrong? Here's the script.

Subform12.presence = "visible";

app.execMenuItem("SaveAs");

1 Accepted Solution

Avatar

Correct answer by
Level 7

LiveCycle is event based, and generally will not re-layout a page until the event completes. Try putting your Subform12.presence = "visible"; code in the preSave event.

View solution in original post

5 Replies

Avatar

Correct answer by
Level 7

LiveCycle is event based, and generally will not re-layout a page until the event completes. Try putting your Subform12.presence = "visible"; code in the preSave event.

Avatar

Level 9

I have a FormCalc script in the preSave that enters a date. Can I also have JavaScript in the same event or do I need to convert the Subform12.presence = "visible"; to FormCalc? If I do have to convert the JavaScript, can you tell me how? (I am only familiar with JavaScript).

Thanks

Avatar

Level 9

I put the following script in the preSave event and the saveAs script in the click event but it still saves before it makes this subform visible.


Form1.Subform11.SaveAs::preSave - (FormCalc, client)


if(Subform1.Originator eq null)then


(Subform11.OriginatorNotifiedDate eq null)


else


Subform11.OriginatorNotifiedDate.rawValue = Concat(Num2Date(date(), "EEE M/D/YYYY "), Num2Time(time(), "h:MM A"))


OriginatorNotifiedDate.presence = "visible"


endif


Avatar

Level 9

The preSave does not work. Whatever I do the Save As fires first. I created an if statement that should only run the SaveAs if the subform I want visible is in fact visible but Save As runs first every time. Can anyone help me with this?

Avatar

Level 9

I just tried this on a form that is not connected to a database and it works as you suggested (using preSave). I have an identical form that is connected to a database and preSave does not work. No idea why! How frustrating!