web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to pass values to another form without using clicked method in args?

(0) ShareShare
ReportReport
Posted on by 1,295

Hi,

 i would like to ask if how to get the date value in another form without using clicked method? 

Form A: I need to get the fromDate value only.

4010.Untitled.png

Assettrans Form:

7633.Untitled1.png

I will use the init form and us the "fromDate" in Form A as part of the condition to hide a record if transdate<fromDate. Can anyone help me what method to use? thank you.

*This post is locked for comments

I have the same question (0)
  • DavidGunawan Profile Picture
    1,381 on at

    Hi Ivan,

    Can you elaborate more about your requirement? Why do you prefer to not use clicked method to pass the args.

  • Iulian Cordobin Profile Picture
    8,201 on at

    Is the second form opened from a button on the first form (form A)?

  • SII1MNL Profile Picture
    1,295 on at

    The form A:

    the value from "FromDate field is the only thing I need to get. on the grid table of the form when I right click AssetID I click on view Details. then FixedAssetForm will show then I click on ValueModel button then ValueModelsform(assetbook) will open then when I click on transaction tab Form B(Assettrans Form) will open

    Form B is the asset transaction where I can hide the record based from Assettrans.TransDate<fromDate. then it will hide records.

    is this possible?

  • SII1MNL Profile Picture
    1,295 on at

    On Form A there's a grid table where I populate records according "from" - "to" date then when I right click the assetID I select view details

  • Johnkrish Profile Picture
    781 on at

    Hi SII1MNL,

    try to get the FromDate value by using the Record reference (ex: custName, Voucher Number, etc..)available in the FormA, while opening FormB. Write the code in Form init method to retrive the date.

    Regards,

    Johnkrish

  • Suggested answer
    XB Profile Picture
    1,875 on at

    You always can call a method from first form.

    In the first form create a method to return fromDate 

    Ex:

    public FromDate getFromDate()
    {
    return fromDate; 

    }

    in the second form create a parm method from caller object

    Ex:

    //Of course you need to declarate a callerObject on your classDeclaration

    public Object parmCallerObject(Object _callerObject = callerObject)
    {
    if (!prmisDefault(_callerObject))
    {
    callerObject = _callerObject;
    }

    return callerObject;
    }

    on init method

    this.parmCallerObject(element.args().caller());

    and now you be able to call a method from first form

    private void updateDesign()
    {
    if (formHasMethod(callerObject.owner(), "getFromDate"))

    {
    FromDate = callerObject.owner().getFromDate();

    }
    }

  • SII1MNL Profile Picture
    1,295 on at

    I just want to get from form A( fromdate value only) and right click then select view details. i opened 3 forms already please see the attached screenshot above. Is this still possible? Thank you.

  • Mea_ Profile Picture
    60,284 on at

    Hi Ivan,

    Approach proposed by Javier Biesa could help you. So from form B you can get access to form A and get date from there, than from form C you can get access to B and so on...

    It does not really meter how much form you have in the chain 3 or 23 approach still the same.

  • Suggested answer
    XB Profile Picture
    1,875 on at

    As I say you could call a method from form A (for example getFromDate); my point is that you can call getFromDate on init method from forms B and C and set as a filter, but If you later change value on form A of course change will not be reflected on opened forms.  

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans