Wednesday, December 16, 2015

AX 2012:get current client language

get current client language


                                            companyinfo::languageId().

Monday, December 7, 2015

Alternative to Google Chrome

Alternative to Google Chrome : SRWare

If you have privacy concerns and beloved google chrome bothers you about privacy,Well this is for you all

SRWare Iron: The Browser of the future
Overview
News
Chrome vs Iron
- FAQ (frequently asked questions)
Download
 


SRWare Iron: The browser of the future - based on the free Sourcecode "Chromium" - without any problems at privacy and security

Google's Web browser Chrome thrilled with an extremely fast site rendering, a sleek design and innovative features.  But it also gets critic from data protection specialists , for reasons such as creating a unique user ID or the submission of entries to Google to generate suggestions. SRWare Iron is a real alternative. The browser is based on the Chromium-source and offers the same features as Chrome - but without the critical points that the privacy concern.

We could therefore create a browser with which you can now use the innovative features without worrying about your privacy.

We want our users to participate in our work and make the browser free to download under the name "SRWare Iron" into the net.

What does Iron makes different? Read here.



* Chrome and Google are registered trademarks of Google Inc. 

EP : Hide Webmenu Menuitem

 Hide individual menuitem from webmenu

//create OnSetMenuItemProperties event

     protected void AxToolBar_SetMenuItemProperties(object sender,                                                                                                          SetMenuItemPropertiesEventArgs e)
    {
        // Remove the menu item context (query string will be empty)
        if (e.MenuItem.MenuItemAOTName == "EP_XXXXXXXX") //
        {
            e.MenuItem.Hidden = true;
        }
        if (e.MenuItem.MenuItemAOTName == "EP_XXXXXXXX")
        {
            e.MenuItem.Hidden = true;
        }
     }

AX 2012: Access infolog in EP

    Access infolog in EP 

using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;
using ApplicationProxy = Microsoft.Dynamics.Portal.Application.Proxy;

    private ISession AxSession
    {
        get
        {
            AxBaseWebPart webpart = AxBaseWebPart.GetWebpart(this);
            return webpart == null ? null : webpart.Session;
        }
    }
    protected void AxGridView1_SelectedIndexChanged(object sender, EventArgs e)
    {    
        Proxy.Info objInfoLog = new Proxy.Info(this.AxSession.AxaptaAdapter);
        objInfoLog.add(Proxy.Exception.Warning, "Hello World");
    }

AX 2012: Get Current record in EP

    How do I pass the RecId of the selected record in the list page     to the user control?


Setting the proper properties on the menu item in the list page form will pass the record to the              web user control.
On the menu item just set the NeedsRecord to Yes (not mandatory, but better to have it set in               order for the button to be disabled/enabled), and the DataSource property to the table you want           to have its record passed.

In your user control just add an AxDataSource for a DataSet having the same table, and you will         get your record.

Then just get the record using a standard call in EP as shown (you must also have the                           DataSourceView method implemented):

internal IAxaptaRecordAdapter GetCurrentDatasourceRecord()

{

       IAxaptaRecordAdapter record = null;

       if (this.DataSourceView.DataSetView != null &&

           this.DataSourceView.DataSetView.GetCurrent() != null)

       {

           //setting the record as the current record in the datasource

           record = this.DataSourceView.DataSetView.GetCurrent().GetRecord();

       }

       return record;

   }

AX 2012 : Change Toolbar webmenu by code

 Change Toolbar webmenu by code  in Enterprise Portal

    protected void AxGridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataSetViewRow row;
     
        // Retrieve the current row.
        row = AxDataSource1.GetDataSet().DataSetViews["LoanRequest"].GetCurrent();
     
       // Retrieve the value.
       WorkflowStatus = row.GetFieldValue("WorkFlowStatus").ToString();
        Proxy.Info objInfolog = new Proxy.Info(this.AxSession.AxaptaAdapter);
     
        if (Convert.ToInt32(WorkflowStatus) == 1 || Convert.ToInt32(WorkflowStatus) == 5)
        {
            AxGridView1.AllowDelete = true;
            AxToolBar1.WebMenuName = "LoanRequest";
        }

        else if (Convert.ToInt32(WorkflowStatus) == 2 || Convert.ToInt32(WorkflowStatus) == 3 ||                 Convert.ToInt32(WorkflowStatus) == 4)
        {
            AxGridView1.AllowDelete = false;
            AxToolBar1.WebMenuName = "LoanRequestNotEdit";
        }

        else
        {
            //Do nothing
        }
    }

AX 2012 : Add Custom lookup on EP

Add Custom lookup on EP

The trick is to override datasetLookup() on Dataset > data source > field > methods. You will not find this method in the list of override methods so just create this as new method.
the table which we are using for lookup should be in the Dataset


public void dataSetLookup(SysDataSetLookup sysDataSetLookup)
{
    List list = new List(Types::String);

    Query query = new Query();

    QueryBuildDataSource    queryBuildDataSource;

    QueryBuildRange qbr;

    // Add the table to the query.

    queryBuildDataSource  = query.addDataSource(tableNum(DependentDetails));

    //add the range

    qbr = queryBuildDataSource.addRange( fieldnum(DependentDetails, PersonnelNumber));

   // qbr.value(DirPersonUser::currentWorkerPersonnelNumber());

   // qbr.status(RangeStatus::Locked);

     // Specify the fields to use for the lookup.

    list.addEnd(fieldStr(DependentDetails,DependentId));

    list.addEnd(fieldStr(DependentDetails,Name));


     sysDataSetLookup.parmLookupFields(list);

     // Specify the field that is returned from the lookup.

    sysDataSetLookup.parmSelectField('DependentId');

     // Pass the query to the SysDataSetLookup so that the query is used.

    sysDataSetLookup.parmQuery(query);
 
}

Table browser URL in D365FO

Critical Thinking icon icon by Icons8