Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Need to find a way to RE-open a form.

Hi guys.

I have a couple of situations where calling Result.Refresh(true) from a C# Business Rule doesn't work as I expected it should.

These business rules are triggered by Actions available after Last Command is Select.

One will generate a Blob field content programatically and Update the database with its content. After doing that, I expected Refresh to show the Blob Thumbnail, but it doesn't, not even refreshes the place holder of it.
Another one will update a Status field content, which is used to show the Status bar on the form. After updating its content, I call Refresh(true) as well, but the Status bar is not shown. And yes, I need to do it from a C# business rule since there are other things to check before the Status field gets changed.
In both situations, the user has to Close the form and re-open it, and then everything shows alright. I need to do this programatically. I have tried many sorts of Actions to run AFTER the Custom Action and set it to many different commands combinations but I have had no success. The closer I got was an Action with the Back command, which takes the user back to the grid and forces them to open again to see the refreshed contents.

Since I have a feeling I won't get the Result.Refresh to be changed to really refresh the whole form, would anyone know of a trick I could apply to have the form to be closed and opened without the user intervation?

Thanks in advance.

Ivan
(COT 8.7.14.0, Unlimited, TouchUI, SPA)
1 person has
this question
+1
Reply
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • Hi Dan.

    Thanks so much for the reply.

    I hope I can. I just have no idea of how to do it. I am searching the forum now and the docs, I guess I would "Navigate" to it in the Business Rule, is that so?

    If you have any directions, I would appreciate.

    Cheers.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • You are right about using them with some navigation command.

    First I would recommend you see if you can “re-open” your form correctly using the parameters first.

    Take a look at
    https://codeontime.com/learn/data-con...
    Note: the commands are case sensitive

    Create a URL in a text editor with your applications parameters. In my application that would look like:

    MasterListsIndividuals?_command=Select&_argument=editForm1&IndividualID=1&_controller=Individuals&_display=IndividualID

    Add that after the /pages/ portion of your application i.e.
    http://localhost:1372/pages/MasterLis...

    That should open your form

    If you get that working then you need to create and execute that url in some sort of business rule.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • VB code example:

    Result.NavigateUrl = String.Format("cases?_command=Select&_argument=editForm1&CaseID=" + instance.CaseID.ToString + "&_controller=Cases")
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • Hi Dan.

    Thank you so much for the attention!

    Yep, this worked almost perfectly. The issue is that the user is in a modal Edit Form in TouchUI, and then when I "navigate" inside the business rule, the editForm1 expands to the whole page, which looks a bit odd.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • Adding to the case...

    I gave it up to make the Action Custom, Argument = MyArgument and available "When Last Command Name" were Select. Instead set it to Update, with the same argument but when last command = Edit. This way, I could create another Action with command Select, argument editForm1 and when last command = Update and argument = MyArgument.

    Now, the user has to go into Edit first and then the Action button is available. Once clicked, the business rule does its magic and once fineshed, the Action to Select it back works fine.

    Maybe we could have a new Action feature which could CloseAndReopen, this way we would be able to offer Actions once the form is just in Select mode.

    Thanks Dan!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited

  • Hey Zack!

    Nice to hear from you.
    Well, I guess it could. But the idea is to have an Action on Select, not Edit. Maybe the user is not given priviledge to Edit but should be able to change a Status field through an Action. This Status field is the base for the form Status Bar. The update happens inside a Business Rule. From the Business Rule, I haven't found a way to refresh the form in a way that the Status Bar would also be refreshed. So, basically the form has to be re-opened for the Status Bar to be shown correctly.
    All this also happens with blob fields, Result.Refresh from a business rule won't refresh its contents, in case they were changed programatically. So, it is also necessary to re-open the form.
    The only way I have found for this to happen is when the form is in an Editing state, using an Update Action.

    If you read all this at this point and got what I am trying to mean, you are my hero. :-)

    Cheers!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated kidding, amused, unsure, silly happy, confident, thankful, excited