SBX - Search With Button

SBX - Forum Post Title

Hide parameters in report dialog

Microsoft Dynamics AX Forum

Roger M. asked a question on 20 Apr 2017 10:41 AM
My Badges

Question Status

Verified

Hi,

I am implementing new Report from the scratch using a RDP class. I use a controller class, a contract class to get recId and tabledID when is called from a form. Depend on the tableID I need to retrieve some information or another. For that I use preRunModifyContract. It works fine. Maybe exist a better way to achieve that.

the problem is when I execute the report, the system display a form (see below) to choose printer or whatever. In that form the contract parameters are shown. I don't want that because they are for internal purpose. Exist any way to hide that fields / parameters?

for contract I created this methods:

[
DataMemberAttribute('tabledId'),
SysOperationLabelAttribute(literalStr('tableId'))
]
public TableId parmtableId(TableId _tableId = tableId)
{
tableId = _tableId;
return tableId;
}
[
    DataMemberAttribute('recId'),
    SysOperationLabelAttribute(literalStr('recId'))
]
public RecId parmrecId(RecId _recId = recId)
{
    recId = _recId;
    return recId;
}

If I comment the DataMemeberAttribute the values for tableid and recId are not stored but they are not shown in the form. I am bit stacked.

thank you
Reply
Martin Dráb responded on 20 Apr 2017 11:42 AM
Verified Answer

Decorate the method with SysOperationControlVisibilityAttribute(false).

By the way, you don't need SysOperationLabelAttribute if it isn't visible.

Reply
Zain Bokhari responded on 20 Apr 2017 2:29 PM
My Badges
Verified Answer

Martin is right you should change your contract class methods like this.

[

 DataMemberAttribute('tabledId'),

 SysOperationControlVisibilityAttribute(false)

]

public TableId parmtableId(TableId _tableId = tableId)

{

  tableId = _tableId;

  return tableId;

}

[

  DataMemberAttribute('recId'),

  SysOperationControlVisibilityAttribute(false)

]

public RecId parmrecId(RecId _recId = recId)

{

  recId = _recId;

  return recId;

}

Or, you can also go to the visual studio and change the parameter's visibility property value to hidden.

Reply
Roger M. responded on 25 Apr 2017 11:00 AM
My Badges

Is this assumtion  valid for SalesQuotationReport which has a different kind of form (specially in journal)? I tried with no success.

Thank you

Reply
Zain Bokhari responded on 25 Apr 2017 3:08 PM
My Badges
Suggested Answer

You mean the parameter visibility? Yes that is valid in case of all reports.

In the Sales Quotation report parameters are there but parameter dialog is not shown at all. So you don't see anything altogether. What exactly did you try?

Reply
Roger M. responded on 26 Apr 2017 1:41 AM
My Badges

Hi Zain,

Basically the user should decide if he wants company logo on the report by clicking checkbox and decide what kind of technical information wants to display (brief, normal, comprensive) in quotation. The categories corresponds to enum. I guess the system should create a combobox. But it is a user decision. I has no automatic criteria to decide that. And create a menu option for each combination could be too much.

thank you

best regards

Roger

Reply
LongTNH.AX responded on 26 Apr 2017 3:35 AM
My Badges
Suggested Answer

Hi Roger M,

You can try to override method showDialog() in contract class and set return value = false.

Reply
Zain Bokhari responded on 26 Apr 2017 2:44 PM
My Badges

Hi Roger,

Actually sales quotation report has a bit complex process. Like you see the on the click method of the Print buttons on Quotation Journal, there is another method "launch report" on the form which is called instead of a direct call to SalesQuotationConttroller if Project 3 configuration is enabled.

I'm afraid you will have to dig in and trace where the parameter dialog options can be enabled if possible. Or wait for someone who has worked on the same issue and can guide you on this. :)

Reply
Roger M. responded on 2 May 2017 3:04 AM
My Badges

Contract has no showdialog method.

Reply
Roger M. responded on 2 May 2017 3:11 AM
My Badges

In the case we use SalesQuotationReport it seems this way doesn't work. Do you know how to populate parameters in SalesauotationReports or SalesInvoiceReports? They lookslike a bit different than standard RDP Reports. thank you

Reply
Zain Bokhari responded on 2 May 2017 3:42 AM
My Badges

Roger please post a new thread with that question and detail for where exactly is it that you need help, so everyone can help.

Thanks.

Reply
Martin Dráb responded on 20 Apr 2017 11:42 AM
Verified Answer

Decorate the method with SysOperationControlVisibilityAttribute(false).

By the way, you don't need SysOperationLabelAttribute if it isn't visible.

Reply
Zain Bokhari responded on 20 Apr 2017 2:29 PM
My Badges
Verified Answer

Martin is right you should change your contract class methods like this.

[

 DataMemberAttribute('tabledId'),

 SysOperationControlVisibilityAttribute(false)

]

public TableId parmtableId(TableId _tableId = tableId)

{

  tableId = _tableId;

  return tableId;

}

[

  DataMemberAttribute('recId'),

  SysOperationControlVisibilityAttribute(false)

]

public RecId parmrecId(RecId _recId = recId)

{

  recId = _recId;

  return recId;

}

Or, you can also go to the visual studio and change the parameter's visibility property value to hidden.

Reply
Zain Bokhari responded on 25 Apr 2017 3:08 PM
My Badges
Suggested Answer

You mean the parameter visibility? Yes that is valid in case of all reports.

In the Sales Quotation report parameters are there but parameter dialog is not shown at all. So you don't see anything altogether. What exactly did you try?

Reply
LongTNH.AX responded on 26 Apr 2017 3:35 AM
My Badges
Suggested Answer

Hi Roger M,

You can try to override method showDialog() in contract class and set return value = false.

Reply

SBX - Two Col Forum

SBX - Migrated JS