Monday, August 30, 2021

Get the Legal entities which were not assigned to Financial dimension Values in D365fo using X++

 Get the Legal entities that were not assigned to Financial dimension Values.


     DimensionFinancialTag dimensionFinancialTag;

#define.QuickKey('Financial dimension') while select dimensionFinancialTag where dimensionFinancialTag.FinancialTagCategory == DimensionAttribute::findByName(
                                                            #QuickKey, false).financialTagCategory() { Ledger ledgerList; DimensionAttrValueLedgerOverride dimensionAttrValueLedgerOverrideList; CompanyInfo companyInfoList; DimensionAttributeValue dimAttributeValue = DimensionAttributeValue::
                                                        findByDimensionAttributeAndEntityInst(
                                                            DimensionAttribute::findByName(
                                                            #QuickKey).RecId,
                                                            dimensionFinancialTag.RecId); while select DataArea from companyInfoList join RecId from ledgerList where ledgerList.PrimaryForLegalEntity == companyInfoList.RecId notexists join RecId from dimensionAttrValueLedgerOverrideList where dimensionAttrValueLedgerOverrideList.Ledger == ledgerList.RecId && dimensionAttrValueLedgerOverrideList.DimensionAttributeValue ==
                                                            dimAttributeValue.RecId { line = [companyInfoList.DataArea, dimensionFinancialTag.Value]; val = val +"\n"+ strReplace(con2Str(line),',','|'); } info(val); }


Keep daxing!!

Wednesday, August 18, 2021

Get method is called from form or not in d365FO

Get method is called from form or not.


    If ( FormDataUtil::isFormDataSource(this)) { info('test'); } if (FormDataUtil::getFormDataSource(this)) { FormDataUtil::getFormDataSource(this).research(); FormDataUtil::getFormDataSource(this).findRecord(Table buffer); }


Keep Daxing!!

Tuesday, August 17, 2021

null Value From Type in D365FO

Assign null values based on type:


String:

 nullValueFromType(Types::String);

strMin();

Real:

nullValueFromType(Types::Real)


Integer:

nullValueFromType(Types::Integer)

 


Keep Daxing !!

Based on User group enable/disable the form controls in D365FO using X++

Based on User group enable /disable the form controls

    UserGroupList userGroupList; ; select firstonly RecId from userGroupList where userGroupList.groupId == VendParameters::find().UserGroupId && userGroupList.userId == curUserId(); this.form().design().showNewButton(userGroupList.RecId ? 1 :0);


Keep Daxing !!