Views and Status Help

Hey all,

Im encountering the following error when trying to change the status from incomplete to complete: -

‘Someone else modified this document at the same time’

I dont get why I am getting this error so any help given will greatly be appreciated.

The view displays all the tasks that need to be completed and the formula used in the button is: -

@Command([EditDocument]); @SetField(“Status”;“Complete”);

@SetField(“CompletedDate”;@Now); @Command([FileSave]);@Command([ViewRefreshFields])

All the information displayed is pulled from a task form and so for the tasks currently marked as incomplete i would like to select it once(without opening the field) and click on the complete field!

Any ideas?

Thanks in advance

Gem

Subject: Views and Status Help

are you triggering the code from view to affect selected documents? if so all you need is:

FIELD Status := “Completed”;

FIELD d CompletedDate := @now;

you don’t need save or refresh, it will all happen automatically.

Subject: RE: Views and Status Help

Hello Basir,

Yeah Im triggering the code from the view.

I have just copied that formula and tested it the status still has not changed…

Any other ideas?

Thanks

Gem

Subject: RE: Views and Status Help

HI Gem, I tested again to make sure and it works fine for me. Are you sure you select the document before you click the button?

Subject: RE: Views and Status Help

Hell again.

Yeah I select the field i want to change the status to complete and nothing appears to change.

I was wondering could this be down to how i created the view.

What i have done is on one of my forms i have a field called ViewInfo with this formula

@Left(category;27) + " - - " + @Left(Task;100) + " - - " + status + " - - "

Therefore the information is displayed in a long string e.g.

Something – Something – Incomplete

In the view I entered ViewInfo as the column value to display the information.

Thanks,

Gem

Subject: RE: Views and Status Help

Actually,

You are right it does change the status and i can see this when i open the field up…

However it doesnt appear to refresh the changes made on the view itself even if i press f9 or close and re-open the view again.

Is there a way of refreshing the view?

Sorry about the other post…you were right.

Thanks

Gem

Subject: RE: Views and Status Help

If you change any field value from the view level, any logic coded into the form is not executed. In particular, your ViewInfo field is not refreshed. Consequentially, what is displayed in the view doesn’t change, until you refresh the document.

You could either add more code to change the ViewInfo field as well. That’s a bit ugly, because from then on you have to maintain the code in two places. Or you could try and add an @Command([ToolsRefreshSelectedDocs]) to your action. That’s a bit ugly too, because it is potentially slow.

Subject: RE: Views and Status Help

Hi Harkpabst,

Ive tried the @Command([ToolsRefreshSelectedDocs]) in my formula and the status still doesnt appear to change on the view. However, if i open the field the status has changed to complete. I know you said its slow so I have waited to see if it would change but it didnt…

Thanks for spending time helping me

Gem

Subject: RE: Views and Status Help

For the view to refresh, the only important point is, if the contents of your ViewInfo field is refreshed or not. Since you do not display the Status field in the view, updating its value will not help you (though it is required from the application logic point of view, of course).

I think that @Command([ToolsRefreshSelectedDocs]) really should update the view display, IF the ViewInfo field is computed (not computed when composed).

However, I agree with Basir: Concatenating values in one field for view display is most useful in columns, that display response documents (because you can only have one (active) column of that type). It can also be useful to save the update task from some heavy computations where very complex column formulas would be required. But as you see, this advantage comes at the price of having to refresh the document each time you make a change, which might just turn out counter-productive.

Subject: RE: Views and Status Help

Thanks both for your help really appreciated it.

Ive gone with your advice and now its working!

Woohoo! Thanks :o)

gem

Subject: RE: Views and Status Help

The best practice would be to remove the ViewInfo field and put the formula you used in this field directly in the view column. This way you don’t have to refresh the document and view will automatically be refreshed