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)

Report Dialog parmShowDialog

(1) ShareShare
ReportReport
Posted on by 3,542

public static void main(Args _args)

{

OHSDevelopmentPlanController controller = new OHSDevelopmentPlanController();

for (int i=1; i<=10001; i++)

{

controller.parmShowDialog(false);

}

controller.parmArgs(_args);

controller.startOperation();

}

I tried removing the text fonts.....

I was struggling with the dialog of my contract class displaying even though I called parmshowdialog(false). Calling the method 10001 times didn't actually do the trick. (I don't know what did the trick.)

I called the method parmShowDialog(false) {before & after startoperation and many other combinations} and rebuilt my solution numerous times but still the dialog popped up. I think after I debugged it, it stopped displaying (didn't change anything). Obviously there is something I don't get. What could cause my call to the parmShowDialog() to be ignored? And then be magically accepted after hours of wrist cutting?

Also (I have a hunch it is related to this question), I have noticed that even after I remove parm methods in a contract class, the dialog still picks up those parameters (in other words prompts me on the UI for a value). Where are these values stored? Is there something I need to refresh? I can supply more info if needed :)

Thank you for reading

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    I think that the parameter is saved and when you open the dialog again, it loads stored values (including the value of showDialog), which overwrites what you set there. You could overwrite it after values got loaded (but before the dialog is executed), modify packing to ignore showDialog or disable storing last values completely for this report.

    Note that calling anything after startOperation() will have no effect; that's way too late.

    By the way, please separate tags with comma (you attached a single tag parmShowDialog contract controller DP dialog report SSRS).

  • Pete Alberts Profile Picture
    3,542 on at

    Thanks for the reply.

    Just checking: Do you mean by "Disable storing last values completely for this report":

    controller.parmLoadFromSysLastValue(false);

    I noticed that the above mentioned method as well as parmShowDialog have the following comments:

       /// <summary>

       ///    Microsoft internal use only.

       /// </summary>

       /// <param name="_showDialog">A <c>boolean</c> Enumeration Type.</param>

       /// <returns>A <c>boolean</c> Enumeration Type.</returns>

    Does the fact that the methods are for "Microsoft internal use only" have any significant implications on my code?

    The dialog is not showing at the moment, which is great.

  • Pete Alberts Profile Picture
    3,542 on at

    Now that the dialog is not displaying, I am getting an error / incorrect data on code logic I edited quite a while ago. Thus I assume the report was not running my new logic for quite a while, even though I rebuilt and deployed the report multiple times. Lol this is really getting me down. Do you know what the cause of this could be?

  • Pete Alberts Profile Picture
    3,542 on at

    public class OHSDevelopmentPlanController extends SRSReportRunController

    {

       public static void main(Args _args)

       {

           OHSDevelopmentPlanController controller = new OHSDevelopmentPlanController();

           controller.parmArgs(_args);

           controller.parmReportName(ssrsReportStr(OHSDevelopmentPlan,BaseDesign_Portrait));

           controller.parmLoadFromSysLastValue(false);

           controller.parmShowDialog(false);

           controller.startOperation();

       }

       /// <summary>

       ///

       /// </summary>

       protected void preRunModifyContract()

       {

           super();

           HcmDiscussion hcmDiscussion = this.parmArgs().record() as HcmDiscussion;

           HcmWorker hcmWorker = HcmWorker::Find(hcmDiscussion.Worker);

           OHSDevelopmentPlanContract contract = this.parmReportContract().parmRdpContract();

           contract.parmDiscussionRecId(hcmDiscussion.RecId);

           contract.parmWorkerName(hcmWorker.name());

           contract.parmWorkerTitle(HcmPosition::Find(

    HcmWorkerHelper::getWorkerPrimaryPositionAssignment(

    (hcmWorker.RecId).Position).description());

           contract.parmWorkerEmploymentDate(HcmEmployment::findByWorkerLegalEntity(

    hcmWorker.RecId,CompanyInfo::find().RecId).ValidFrom);

           contract.parmDiscussionName(hcmDiscussion.Description);

           contract.parmDiscussionOverview(hcmDiscussion.Overview);

           contract.parmDiscussionRating(HcmRatingLevel::Find(hcmDiscussion.FinalEmployeeRating).Description);

           contract.parmDiscussionRatingComment(hcmDiscussion.Comments);

       }

    }

  • Pete Alberts Profile Picture
    3,542 on at

    I printed the problematic line in bold. I am quite sure I made a logic error (which I will be sorting out now), but the point is that the line has been there for ages, but I only started getting problems now (yes with the same test data).

    Does parmLoadFromSysLastValue cause previous code to be compiled and not my current code?

  • Verified answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Can you tell us more than that you're getting a problem?

    But no, calling parmLoadFromSysLastValue() has no impact on compilation; compilation is done before any code can execute. Make sure you distinguish between compilation errors and errors in execution. I assume that your code was compiled correctly, but it wasn't executed, because contract was already initialized before. What parmLoadFromSysLastValue() did is that now the code is getting executed.

  • Pete Alberts Profile Picture
    3,542 on at

    I didn't supply info on that bold line problem, because I can solve it. (I already did.) I just mentioned it, because it relates to the first problem: Code I write which for some reason doesn't have effect.

    You answered my question in your post above - thank you very much. Yes I am capable of distinguishing between errors - I just don't have the right lingo....yet :)

    Last question: Is it acceptable practice to call parmLoadFromSysLastValue(false) in general when using the SRSReportRunController class (to prevent the problems I encountered)? Or maybe just use it while developing and then remove the line after you are finished with design?

  • Verified answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    If it's not needed to store any values from the last time, I find parmLoadFromSysLastValue(false) completely acceptable (but not common).

    Of course, if you're not going to switch parmShowDialog() again, you can happily keep loadFromSysLastValue enabled. It will always contain false and everything will work as expected. Just if you already have the implementation with showDialog = true deployed in other environments, you would need to delete the related records from SysLastValue table.

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
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans