Announcements
No record found.
I guess I am miss understanding on how to retrieve the value from the text box aka formstringcontrol on the form. Do I need to declare it to be able to access the control? I figured being on the control it would know the location.
You made a mistake when trying to debug your code. I assume that the form control exists, but an obvious bug is that your consumeSoap variable is empty and trying call the method on null leads to NullReferenceException.
If Main is an instance method, you must create an instance of ConsumeSoapMichelinFunds and put it into consumeSoap variable before you can call the method.
If it's a static method, call it as a static method (ConsumeSoapMichelinFunds::Main()).
The variable isn't empty when I click the button. The consumeSoap variable is a class instance. The MichelinBillto is the formstringcontrol on the form.
internal final class ConsumeSoapMichelinFunds { public void Main(str _args) { ExternalWebServices.GetBDFFund GetBDFFund = new ExternalWebServices.GetBDFFund(); real CoopFunds = 0; real AMFFunds = 0; var tempFund = GetBDFFund.getMichelinFunds(_args,CoopFunds, AMFFunds, ""); Info(strFmt("%1", tempFund)); } }
If the variable is populated, then you didn't show us your actual code. If it's the case, please show us the right one.
If it's the correct code, then you're wrong. You don't have any code putting any value to consumesoap variable.
By the way, use a different name for your method - main() has a special meaning.
I have created a Form with 2 FormStringControls on it along with a Button. I want to get the billto formcontrol info into the class method.
Form:
[Form] public class MichenlinConsumeForm extends FormRun { [Control("Button")] class MichelinSubmit { /// /// /// public void clicked() { Args args; FormRun formRun; super(); if(element.args()) { args = new Args(); FormRun michform = new FormRun(args); ConsumeSoapMichelinFunds consumesoap; //class consumesoap.GetBillToInfo(michbillto.text()); } } } }
Internal Class:
using ExternalWebServices; using System.ServiceModel; internal final class ConsumeSoapMichelinFunds { public void Main(str _args) { } public void GetBillToInfo(str Billto) { ExternalWebServices.GetBDFFund GetBDFFund = new ExternalWebServices.GetBDFFund(); real CoopFunds = 0; real AMFFunds = 0; var fund = ""; var tempFund = GetBDFFund.getMichelinFunds(Billto,CoopFunds, AMFFunds, ""); Info(strFmt("%1", tempFund)); } }
You still have the same bug there.
ConsumeSoapMichelinFunds consumesoap; // This creates an emoty variable (containing null) consumesoap.GetBillToInfo(...); // Here you're trying to call a method on null, which must fail
If you want an instance method, you need to create an instance of the class. For example:
ConsumeSoapMichelinFunds consumesoap = new ConsumeSoapMichelinFunds(); consumesoap.GetBillToInfo(...);
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 613
André Arnaud de Cal... 455 Super User 2026 Season 1
Syed Haris Shah 292 Super User 2026 Season 1