الأربعاء، 20 يناير 2016

AX 2012: Using X++ Get the NumberSeq and Voucher for LedgerJournalTrans Table


LedgerJournalNameId     journalName = "VENPM";
NumberSeq numberseq;

numberseq  =  NumberSeq::newGetVoucherFromId((LedgerJournalName::find(journalName ).NumberSequenceTable));

ledgerJournalTrans.Voucher = numberseq.voucher();

الثلاثاء، 19 يناير 2016

CRM 2013 Error: Maximum record limit is exceeded. Reduce the number of records

When you open a chart in CRM 2013 and get this error "Maximum record limit is exceeded. Reduce the number of records", it's because the number of records to fetch is more than 50.000.

To solve do the following:

--****** get the number of records to be fetched ***********
Use MSCRM_CONFIG
Select IntColumn from [MSCRM_CONFIG].[dbo].[DeploymentProperties] 
where ColumnName = 'AggregateQueryRecordLimit'

--*********************** increasing the number of records to be fetched ***
Use MSCRM_CONFIG 
UPDATE [MSCRM_CONFIG].[dbo].[DeploymentProperties] 
SET [IntColumn] = '99999999' 
WHERE ColumnName = 'AggregateQueryRecordLimit'

الخميس، 7 يناير 2016

CRM 2011: Hiding Ribbon Button on Click/Select SubGrid using JavaScript.

function OnSubGridClicked() {
    var GridCtrl = document.getElementById("gridname");
    if (GridCtrl == null || GridCtrl.readyState != "complete") {
        setTimeout('OnSubGridClicked()', 1000);
        return;
    }
    else {
        GridCtrl.onload = HideRibbon;
        GridCtrl.onclick = HideRibbon;
        GridCtrl.onfocus = HideRibbon;
    }
}

function HideRibbon() {
    if (window.top.document.getElementById("RibbonId") != null) {
        window.top.document.getElementById("RibbonId").style.display = "none";
        setTimeout(" HideRibbon('"RibbonId"');", 200);
    }
}

الأربعاء، 6 يناير 2016

CRM 2011: Updating record the plugin was fired by / from does not work.


1- Register in Async-post-update with the check of

if (context.Depth > 1){ return; }  //To Avoid Multiple Trigger Of Same Update Plugin.

2- Register in Sync-post-update:
Try Creating a new Object for Updating the record Like

  Entity test=new Entity("contact");
  test.Id=((Entity)context.InputParameter["Target"]).Id;
  test.Attributes["firstname"]="ABC";
  service.Update(test);