Args args;
FormRun formRun;
;
args = new Args();
args.name(formStr(custtable));
args.caller();
// args.record(_buffer); //si se va a pasar un registro
formRun = classfactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
jueves, 22 de septiembre de 2011
miércoles, 14 de septiembre de 2011
Mostrar un objeto del aot Resource
display Bitmap myBitmap()
{
ResourceNode resourceNode;
Container nodeData;
;
resourceNode = SysResource::getResourceNode(resourceStr(resourceobjectnameAOT));
resourceNode.AOTload();
nodeData = SysResource::getResourceNodeData(resourceNode);
return nodeData;
}
{
ResourceNode resourceNode;
Container nodeData;
;
resourceNode = SysResource::getResourceNode(resourceStr(resourceobjectnameAOT));
resourceNode.AOTload();
nodeData = SysResource::getResourceNodeData(resourceNode);
return nodeData;
}
martes, 6 de septiembre de 2011
Otro ejemplo mas completo que hice, estuvo complicado pero ya esta, sobre las combinaciones finacneras Ax 2012
public static DimensionDynamicAccount CrearCombinacion(DimensionDisplayValue _DimensionDisplayValue)
{
DimensionStorage DimensionStorage;
DimensionAttributeValue dimAttributeValue;
DimensionStorageSegment DimensionStorageSegment;
MainAccount MainAccount;
recid dimHierarchyId;
recid mainAccountRecId;
DimensionValue _DimensionValue;
container cont;
int i;
container dimensiones=["MainAccount","División","Sucursal","CentroCosto"];
;
cont=str2con(_DimensionDisplayValue,"-");
////declarar el objecto
DimensionStorage=DimensionStorage::construct(0,LedgerDimensionType::Account);
for(i=1;i<=conLen(cont);i++)
{
try
{
_DimensionValue=conPeek(cont,i);
if(i==1)
{
dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValueNoError(
DimensionAttribute::findByName(conPeek(dimensiones,i)),
_DimensionValue,
false,
true);
mainAccountRecId= DimensionAttributeValue::find(dimAttributeValue.RecId).EntityInstance;
dimHierarchyId = DimensionHierarchy::getAccountStructure(mainAccountRecId);
DimensionStorage.addHierarchy(dimHierarchyId);
DimensionStorageSegment=DimensionStorageSegment::constructFromValue(dimAttributeValue.CachedDisplayValue,dimAttributeValue);
DimensionStorage.setSegment(i,DimensionStorageSegment);
}
else
{
if(_DimensionValue!="")
{
dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValueNoError(
DimensionAttribute::findByName(conPeek(dimensiones,i)),
_DimensionValue,
false,
true);
DimensionStorageSegment=DimensionStorageSegment::constructFromValue(dimAttributeValue.CachedDisplayValue,dimAttributeValue);
DimensionStorage.setSegment(i,DimensionStorageSegment);
}
else
{
DimensionStorageSegment=DimensionStorageSegment::emptySegment();
DimensionStorage.setSegment(i,DimensionStorageSegment);
}
}
}
catch
{
return 0;
}
}
return DimensionStorage.save();
}
{
DimensionStorage DimensionStorage;
DimensionAttributeValue dimAttributeValue;
DimensionStorageSegment DimensionStorageSegment;
MainAccount MainAccount;
recid dimHierarchyId;
recid mainAccountRecId;
DimensionValue _DimensionValue;
container cont;
int i;
container dimensiones=["MainAccount","División","Sucursal","CentroCosto"];
;
cont=str2con(_DimensionDisplayValue,"-");
////declarar el objecto
DimensionStorage=DimensionStorage::construct(0,LedgerDimensionType::Account);
for(i=1;i<=conLen(cont);i++)
{
try
{
_DimensionValue=conPeek(cont,i);
if(i==1)
{
dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValueNoError(
DimensionAttribute::findByName(conPeek(dimensiones,i)),
_DimensionValue,
false,
true);
mainAccountRecId= DimensionAttributeValue::find(dimAttributeValue.RecId).EntityInstance;
dimHierarchyId = DimensionHierarchy::getAccountStructure(mainAccountRecId);
DimensionStorage.addHierarchy(dimHierarchyId);
DimensionStorageSegment=DimensionStorageSegment::constructFromValue(dimAttributeValue.CachedDisplayValue,dimAttributeValue);
DimensionStorage.setSegment(i,DimensionStorageSegment);
}
else
{
if(_DimensionValue!="")
{
dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValueNoError(
DimensionAttribute::findByName(conPeek(dimensiones,i)),
_DimensionValue,
false,
true);
DimensionStorageSegment=DimensionStorageSegment::constructFromValue(dimAttributeValue.CachedDisplayValue,dimAttributeValue);
DimensionStorage.setSegment(i,DimensionStorageSegment);
}
else
{
DimensionStorageSegment=DimensionStorageSegment::emptySegment();
DimensionStorage.setSegment(i,DimensionStorageSegment);
}
}
}
catch
{
return 0;
}
}
return DimensionStorage.save();
}
lunes, 5 de septiembre de 2011
Pequeño ejemplo de sacar el recid de la combinacion de las dimenciones fincancieras AX 2012
DimensionStorage DimensionStorage;
DimensionAttributeValue dimAttributeValue;
DimensionStorageSegment DimensionStorageSegment;
;
DimensionStorage=DimensionStorage::construct(0,LedgerDimensionType::Account);
//DimensionAttributeValue::findByDimensionAttributeAndValueNoError(
dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValueNoError(
DimensionAttribute::find(5637144840),
"180300",
false,
true);
DimensionStorage.addHierarchy(DimensionHierarchy::find(5637146169).RecId);
DimensionStorageSegment=DimensionStorageSegment::constructFromValue(dimAttributeValue.CachedDisplayValue,dimAttributeValue);
DimensionStorage.setSegment(1,DimensionStorageSegment);
info(int642str(DimensionStorage.save()));
DimensionAttributeValue dimAttributeValue;
DimensionStorageSegment DimensionStorageSegment;
;
DimensionStorage=DimensionStorage::construct(0,LedgerDimensionType::Account);
//DimensionAttributeValue::findByDimensionAttributeAndValueNoError(
dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValueNoError(
DimensionAttribute::find(5637144840),
"180300",
false,
true);
DimensionStorage.addHierarchy(DimensionHierarchy::find(5637146169).RecId);
DimensionStorageSegment=DimensionStorageSegment::constructFromValue(dimAttributeValue.CachedDisplayValue,dimAttributeValue);
DimensionStorage.setSegment(1,DimensionStorageSegment);
info(int642str(DimensionStorage.save()));
Suscribirse a:
Entradas (Atom)