Showing posts with label list page. Show all posts
Showing posts with label list page. Show all posts

Monday, 11 November 2013

listpage enabling override methods(How to write methods on the list page Form in Ax 2012)

for enabling default override methods in list page we will set on property to group as

display target-- client(defautly it is auto we can change as client)




Scenario: I have a menu item that calls some class to do manipulation on the list page Form and I need to refresh the list page now. List pages do not allow writing of code on the Form, as they used interaction class.
Solution: You can write the code on list page buttons by setting DisplayTarget property to “Client” from auto. However after this change, you won’t be able to sue this button on the EP, so if you are thinking of using the same list page on the EP and planning to use the same button there, then do not do it. However f your domain is only the Form then you are good to do this.
Any ways override the clicked method and call research() of the data source to do this

Saturday, 14 September 2013

Listpage interaction class: example

Listpage interaction class:( NetReservationListPageInteraction-interaction class,
NetReservationListPage-listpage name , btnReserve-button name(autodeclaration yes),
NetReservation_NoFilter-listpage query, NetReservationTable-listpage table)


Class declaration:


public class NetReservationListPageInteraction extends ListPageInteraction
{
    smmLeadTable                smmLeadTable;
    smmActivityParentLinkTable  smmActivityParentLinkTable;

    QueryBuildRange             leadProcessRange;
    HierarchyName               selectedProcess;

    NetReservationTable         netReservationTable;
}

selectionChanged:
public void selectionChanged()
{
    super();

    this.setButtonEnabled();

     if(netReservationTable.RentalApprovalState == ApprovalState::WorkflowCompleted)// && NetReservationListPage.& NetAgreement.FinalizeAgree == NoYes::No)
      this.listPage().actionPaneControlEnabled(formControlStr(NetReservationListPage,btnReserve),true);

    else
        this.listPage().actionPaneControlEnabled(formControlStr(NetReservationListPage,btnReserve),false);



}



setButtonEnabled:

void setButtonEnabled ()
{
    boolean                 isCustomer;
    smmOpportunityTable     smmOpportunityTable;
    boolean                 enableContacts = false;
    DirOrgPersonRelations   dirOrgPersonRelations;

    netReservationTable = this.listPage().activeRecord(queryDataSourceStr(NetReservation_NoFilter, NetReservationTable));

   /* isCustomer = DirPartyTable::isCustomer(netReservationTable.Party);

    if (!netReservationTable.RecId || !netReservationTable.Party || isCustomer)
    {
        this.listPage().actionPaneControlEnabled(formControlStr(NetReservationListPage,createCustomer),false);
    }
    else
    {
        this.listPage().actionPaneControlEnabled(formControlStr(NetReservationListPage,createCustomer),true);
    }

    this.listPage().actionPaneControlEnabled(formControlStr(NetReservationListPage,customerButton),netReservationTable.RecId != 0 && isCustomer);
*/

}


setDBEnabled:

public void setDBEnabled()
{
    boolean                 isDraft;
    ;
        /*
    // DNS-Hussain on 12-09-2013

    netReservationTable = this.listPage().activeRecord(queryDataSourceStr(NetReservation_NoFilter, NetReservationTable));

    isDraft = netReservationTable.RentalApprovalState == ApprovalState::NotSubmitted;

    if(NetReservationTable.RentalApprovalState != ApprovalState::NotSubmitted)
    {
        NetReservationTable_ds.allowEdit(isDraft);
        NetReservationTable_ds.allowDelete(isDraft);
    }

    // end.

    this.setButtonEnabled();

     if(netReservationTable.RentalApprovalState == ApprovalState::WorkflowCompleted)// && NetReservationListPage.& NetAgreement.FinalizeAgree == NoYes::No)
      this.listPage().actionPaneControlEnabled(formControlStr(NetReservationListPage,btnReserve),true);

    else
        this.listPage().actionPaneControlEnabled(formControlStr(NetReservationListPage,btnReserve),false);

*/

}


Friday, 6 September 2013

List page and form menuitem enable code

Listpage interaction class:

Code for Action pane button enable and disabling:
1. selectionChanged()
if(NetAgreement.Status == NetAgreementStatus::Approved && NetAgreement.FinalizeAgree == NoYes::No)
      this.listPage().actionPaneControlEnabled(formControlStr(NetAgreementList,FinalizeAgreement),true);

    else
        this.listPage().actionPaneControlEnabled(formControlStr(NetAgreementList,FinalizeAgreement),false);

2. selectionChanged()

public void selectionChanged()
{
    super();

    this.setButtonEnabled();
   
     if(netReservationTable.RentalApprovalState == ApprovalState::WorkflowCompleted)// && NetReservationListPage.& NetAgreement.FinalizeAgree == NoYes::No)
      this.listPage().actionPaneControlEnabled(formControlStr(NetReservationListPage,btnReserve),true);

    else
        this.listPage().actionPaneControlEnabled(formControlStr(NetReservationListPage,btnReserve),false);
   
   
   
}

Action pane button enabling and disabling in form:
Form –datasource-(table of data source)-active method:
1.Active():
if(NetAgreement.Status == NetAgreementStatus::Approved && NetAgreement.FinalizeAgree == NoYes::No)
      FinalizeAgreement.enabled(true);

    else
        FinalizeAgreement.enabled(false);
    //ended by poorna...04/09/2013

    return ret;

2.Active():
if(NetReservationTable.RentalApprovalState == ApprovalState::WorkflowCompleted)//&& NetAgreement.FinalizeAgree == NoYes::No)
      btnReserve.enabled(true);
    else
        btnReserve.enabled(false);



Friday, 2 August 2013

Action pane new ,delete, view button options:

List page:
Edit button:
Open mode- edit
Caller query- auto
Menuitem button-netbuildingview
Form view option-auto
View button:
Open mode- auto                                                                   
Caller query- yes
Menuitem button-netbuildingview
Form view option-auto
Edit in grid :
Open mode- edit
Caller query- yes
Menuitem button-netbuildinglistpage
Form view option-grid

New button:
 Open mode- new
Caller query- auto
Menuitem button-netbuildingview
Form view option-auto

Netbuildingview menu item:

Open mode- new
Caller query- auto
Form view option-Details

Form:

Edit button:
Command-edit
Toggle button-check
Primary-yes
Big-yes
Show shortcut –no
Text-edit
Normal image-10040
Image location-embedded resource
Button display-text & image above

Delete button:
Command –delee

Normal image-10021