Accessing form fields in subform

Hi,

I have a form with subform. In subform, i have a agent, in this agent code, i would like to set a value to field of main form

ie.

agent code:

mainform.textfield.value = 10

Thanks in advance.

Subject: Your question makes no sense

A subform can’t contain an agent.What language are you writing in?

Have you tried to do this and run into a problem? There’s no difference in how you access a field from a subform, versus how you would access it from the form. It’s a document.

If the above does not solve your problem, we need more information about what you’re doing. If you’re not sure what information to supply, the C R I S P Y document might help you.

  • Andre Guirard, IBM/Lotus Development

Useful blog: Best Practice Makes Perfect

Subject: i am using LotusScript

I have agent written in LotusScript. On click of a hotspot button, i am calling the agent by @Command([ToolsRunMacro];“agtFileUpload”)

and its working fine.

i will try to access a field from subform and update.

Subject: Think “document,” not “form” or “subform”

Hi Murugesan,

If you are trying to change the data (the item values on a document,) the form and the subform are not really important. (Okay, they are. But not in the way you might think.)

Since you have the document open in the user interface, you could use methods in either the NotesUIDocument or NotesDocument classes to change the item values, once you correctly set a variable that references one of these.

What do you expect the code to do? What is it doing differently?

It might help to see the code.

– Grant