@Command([FileSave]) does't work

I have an action button that pulls up a dialogbox with ok and cancel. The ‘Ok’ button is suppose to change a field of the selected document then save it, however it doesn’t work. Here is the code behind it:

@SetDocField(@DocumentUniqueID; “s_cdate”; @Today);

@Command([FileSave])

Any suggestions?

Subject: @Command([FileSave]) does’t work

Field s_cdate := @Today;@Command([FileSave])

Subject: RE: @Command([FileSave]) does’t work

To give you more of a focus, the problem is with the @Command([FileSave]) function. If I were to just place that function inside by itself, it won’t work.

Subject: RE: @Command([FileSave]) does’t work

Are you talkin about the ‘ok’ button on the dialog box? I would try moving the close to the button that calls the dialog box, which is most likely not an ‘OK’ button.

Subject: @Command([FileSave]) doesn’t work

Yes, I was talking about the ok button on the dialog box (that I made, not the default one). I tried putting the @Command([FileSave]) function behind the action button after calling the dialogbox and now it gives me an error saying “Cannot execute the specific command”. I tried putting the function above by itself to see if it could just save a file, but it gave me the same error.

Subject: RE: @Command([FileSave]) doesn’t work

I wouldn’t use your own button, to try to close this down, it may only be closing the dialog box, and not the parent document that is closing it. And the cannot execute the specified command, is the parent document in edit mode already? If not, it should be.

Subject: Solved

I didn’t realize the parent document must be opened to save it. So, with that in mind here is my code.

Behind the Action button:

@Command([EditDocument]);

@DialogBox(“Complete Solution”; [AutoVertFit] : [AutoHorzFit] : [SizeToTable] : [NoOkCancel] : [NoCancel];“Complete Solution”);

@Command([FileSave]);

@Command([CloseWindow])

Behind the ok button:

@UpdateFormulaContext;

FIELD s_cdate := @Today;

@Command([CloseWindow])

Thanks for your help.

Subject: @Command([FileSave]) does’t work

In my experience with dialog boxes, the ok and cancel are already there, and there is no code behind them, other than true or false. That is, pass back the information back to the main form.

If anything, put the save and close on the button/action that is calling the dialogbox, after it returns back from the dialog box. I hope that helps.