Notifications
Announcements
No record found.
hello,gusys, i use element.args().caller() can not get the object .but in ax2009 i can get result .could you tell me why?
Hi Tracy,
Add the myBatch buffer into watch window and see if there is any buffer values is passed.
Is myBatch buffer is a class?
Are you calling the form from a class?
Have you passed the parmAccount() value?
Thanks,
Girish S.
yes i calling the form from a class the paramAccount method like this .
public CustAccount paramAccount(CustAccount _custAccount =custAccount)
{
custAccount =_custAccount;
return custAccount;
}
It seems that this particular form wasn't called with a caller.
If you think it's a bug, look at how the form is called. Or you'll need to correct your expectations.
What you have in paramAccount() is irrelevant. It can't be called, because you have no object to call it on. You got the error because you're trying to call paramAccount() on a variable that contains null.
As martin told there is no object on the "myBatch" class buffer, that's why I asked you to add that buffer to watch window and check.
yes ,but why we can init the myBatch object?
If you want to init the myBatch object dont use element.args().caller() - This will return the object that is called from.
If you want to initialize myBatch class, use new keyword to create object for the class, but you won't get customer account as per your scenario.
ok,but in ax2009 i can use element.args().caller().however ,i use new(),the custAcoount can not get value ,System tell m e i need to use static to define custAccount
You're wrong in thinking that element.args().caller() always returns a value. It returns an object set as the caller when opening the current form. It's often empty, e.g. when you open a form from main menu.
The caller is set automatically when a form or a class is opened from through a menu item button on a form and it might (but doesn't have to) be set when a form is opened from code.
the first picture i defined without static .the second picture i defined with static ,now the custaccount have value
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 456 Super User 2025 Season 2
Martin Dráb 429 Most Valuable Professional
BillurSamdancioglu 239 Most Valuable Professional