Author Topic: How to calculate for a computed subform after the form is open?  (Read 890 times)

0 Members and 1 Guest are viewing this topic.

Offline GBTalk

  • Full Member
  • *
  • Posts: 184
  • Karma: +0/-0
    • View Profile
How to calculate for a computed subform after the form is open?
« on: September 29, 2014, 09:17:26 AM »
Here's my problem, I have 3 subforms which I want selectively displayed in the form using computed subform. I have in the form one dialogbox listing all the category.
So depending on the user selection the two subform should be hidden . only one will need to show up. On the basis on the selection of the dialog box a computed field gets it value .
On the basis of the value of that field, I have written the following formula for the Computed Subform.
Code: [Select]
@If(@IsMember("STTP";reportCatMnem);"sttp";@IsMember("STOP";reportCatMnem);"stop";@IsMember("PPI";reportCatMnem);"ppi";"")

It seems it's NOT working. I have exhausted trying other means like adding 'Automatically refresh' on form, subform, on field, but seems it's not working.

Am i missing something here?

Please tell me if I am going wrong somewhere and any solution to the problem.

Thanks.
« Last Edit: September 29, 2014, 09:27:18 AM by GBTalk »

Techronnati | where technology never sleeps

How to calculate for a computed subform after the form is open?
« on: September 29, 2014, 09:17:26 AM »

Mountain View

Offline MrSpecialist

  • Sr. Member
  • *
  • Posts: 343
  • Karma: +1/-0
  • I'm an expert!
    • View Profile
Re: How to calculate for a computed subform after the form is open?
« Reply #1 on: September 29, 2014, 09:30:36 AM »
This is kinda tricky...

Keep in mind that subforms are loaded when the form is loaded. So basically this means that you cannott switch dynamically, without closing and reopening the form. You can do this programatically, but in my opinion it is quite ugly, with a flicker and all. you know what i mean...

But that;s the only idea i can get. you better do some programming to automatically open and close the form to reflect your change.

Offline JusticeLeague

  • Sr. Member
  • *
  • Posts: 354
  • Karma: +1/-0
    • View Profile
Re: How to calculate for a computed subform after the form is open?
« Reply #2 on: September 29, 2014, 09:32:56 AM »
I have solution for you:

Put the following code into onChange or onExit event of your DialogList field .

 
Code: [Select]
Dim workspace As New NotesUIWorkspace
 Dim uidoc As NotesUIDocument
 Dim new_uidoc As NotesUIDocument
 Dim doc As NotesDocument
 
 Set uidoc = workspace.CurrentDocument
 Set doc = uidoc.Document
 doc.form = "MyFormName"
 Call doc.computewithform(True, False)
 Call Workspace.SetTargetFrame("")
 Set new_uidoc= Workspace.editdocument(True, doc)
 uidoc.document.saveoptions = "0"
 Call uidoc.close
'refresh the document
 Call new_uidoc.reload
 Call new_uidoc.refresh

*** dont forget to change doc.form = "MyFormName"  with MyFormName as your form name.


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
210 Views
Last post September 16, 2008, 09:06:32 AM
by h2obubbler
0 Replies
66 Views
Last post April 02, 2009, 06:43:25 AM
by CyborgRepublic
3 Replies
1835 Views
Last post August 13, 2014, 01:55:51 AM
by JusticeLeague
4 Replies
4037 Views
Last post August 17, 2016, 07:51:58 AM
by GBTalk
0 Replies
5 Views
Last post Yesterday at 11:04:25 AM
by rpmolecule

Posting Disclaimer: Any individual may post a message in this forum and may do so anonymously. Therefore, the sole author is exclusively and entirely responsible for all opinions in that message. They do not represent the official opinions of Techronnati, its administrators or moderators or the Techronnati Management. Techronnati is merely acting as an impartial conduit for constitutionally protected free speech and is not responsible and will not be held liable for the content of such messages. All images and service logos are trademarks of their respective owners.