601,100
562,"NULL"
586,
585,
564,
565,"hdlITYA=aXVZ0>^Uf9^=h95`T[?@`mW@^D@dP1qeGChysxRHEG^t7rOzUyu44xJl@N209kEc1Lwprgy]sfWi2XKu^Ei>BVa\rTR;[AlP@TDNto7c=\gHQNj1xKdMbbhfxP6f\lY=>;q[i@pyQ32[UQ^I;1cP@6vjuNVyhqFvXOhlwCWf\:;au\xNR\bkOj0^47p]Uz]>"
559,0
593,
594,
595,
597,
598,
596,
800,
801,
566,0
567,","
588,"."
589,
568,""""
570,
571,
569,0
592,0
599,1000
560,2
pPlan
pVersion
561,2
2
2
590,2
pPlan,""
pVersion,""
637,2
pPlan,please enter the plan name
pVersion,please enter the version name
577,0
578,0
579,0
580,0
581,0
582,0
572,102

#****GENERATED STATEMENTS START****
#****GENERATED STATEMENTS FINISH****

vCubeName = '}ElementAttachments_' | pPlan;
##Delete all version attachments
##Get each attachment type and path
##delete the blob file if type is 'BLOB'

if ( CubeExists(vCubeName) = 1 );
vAttachmentsDim = '}Attachments';
vMeasuresDim = '}AttachmentMeasures';
vAttachmentsSize = DIMSIZ(vAttachmentsDim);
vAttachmentsLooper=1;

vAttachmentsElement='';
vMeasuresElement='';
while(vAttachmentsLooper <= vAttachmentsSize);
  vAttachmentsElement=DIMNM(vAttachmentsDim, vAttachmentsLooper);
  if ( ELLEV(vAttachmentsDim, vAttachmentsElement) = 0 );
     vType=CELLGETS(vCubeName, pVersion, vAttachmentsElement, 'Type');
     vPath=CELLGETS(vCubeName, pVersion, vAttachmentsElement, 'Path');
     vFile = vPath | '.blb';
      if (vType @= 'BLOB');
         if (FileExists(vFile)=1);
             ASCIIDelete(vFile);
          endif;
       endif;
  endif;
  vAttachmentsLooper = vAttachmentsLooper + 1;
end;
endif;

##update cube through a temp subset and a temp view

vSubsetName = 'tempSubset' | numbertostring(RAND);
vDimName = pPlan;
while (SubsetExists(vDimName, vSubsetName)=1);
vSubsetName = 'tempSubset' | numbertostring(RAND);
end;
SubsetCreate(vDimName, vSubsetName);
SubsetElementInsert(vDimName, vSubsetName, pVersion, 1);

vViewName = 'tempview' |  numbertostring(RAND);
while (ViewExists(vCubeName, vViewName )=1);
vViewName = 'tempview' |  numbertostring(RAND);
end;

ViewCreate(vCubeName, vViewName);
ViewColumnDimensionSet(vCubeName, vViewName, '}AttachmentMeasures', 1);
ViewRowDimensionSet(vCubeName, vViewName, '}Attachments', 1);
ViewTitleDimensionSet(vCubeName, vViewName, pPlan);
ViewSubsetAssign(vCubeName, vViewName, pPlan, vSubsetName);
ViewZeroOut(vCubeName, vViewName);
ViewDestroy(vCubeName, vViewName);
SubsetDestroy(vDimName, vSubsetName);

##Delete all task attachments for that version
vCubeName = '}ElementAttachments_}sm_versiontasks@' | pPlan | '@' | pVersion;

if ( CubeExists(vCubeName) = 1 );
vAttachmentsDim = '}Attachments';
vMeasuresDim = '}AttachmentMeasures';
vAttachmentsSize = DIMSIZ(vAttachmentsDim);
vAttachmentsLooper=1;
vAttachmentMeasuresSize = DIMSIZ(vMeasuresDim);
vAttachmentMeasuresLooper = 1;
vTasksDim = '}sm_versiontasks@' | pPlan | '@' | pVersion;
vTasksSize = DIMSIZ(vTasksDim);
vTasksLooper = 1;

vAttachmentsElement='';
vMeasuresElement='';
vTasksElement = '';
while(vTasksLooper <= vTasksSize);
vTasksElement = DIMNM(vTasksDim, vTasksLooper);
vAttachmentsLooper =1;
while(vAttachmentsLooper <= vAttachmentsSize);
  vAttachmentsElement=DIMNM(vAttachmentsDim, vAttachmentsLooper);
  if ( ELLEV(vAttachmentsDim, vAttachmentsElement) = 0 );
     vType=CELLGETS(vCubeName, vTasksElement, vAttachmentsElement, 'Type');
     vPath=CELLGETS(vCubeName, vTasksElement, vAttachmentsElement, 'Path');
     vFile = vPath | '.blb';
      if (vType @= 'BLOB');
         if (FileExists(vFile)=1);
             ASCIIDelete(vFile);
          endif;
       endif;
  endif;
  vAttachmentsLooper = vAttachmentsLooper + 1;
end;
  vTasksLooper = vTasksLooper +1;
end;
endif;








573,3

#****GENERATED STATEMENTS START****
#****GENERATED STATEMENTS FINISH****
574,3

#****GENERATED STATEMENTS START****
#****GENERATED STATEMENTS FINISH****
575,3

#****GENERATED STATEMENTS START****
#****GENERATED STATEMENTS FINISH****
576,CubeAction=1511	DataAction=1503	CubeLogChanges=0	
638,1
804,0
900,
901,
902,
903,
906,
907,
908,
904,0
905,0
909,0
910,0
911,
912,
913,
914,
915,
916,
