Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Custom ProjectActivity Archive

Hello,

I am creating a custom archive based on the project activity archive, it needs to show the following appoinment type's:

1252,1253,1254,1255,1256,1257,1268,1269,1288,1272

and the following document type:

36

I have created the archive below, but it shows some strange behavior, for example:

* when mailings is checked, it only shows documents

* sometimes on first load, it shows the appointments, but on refresh (using the refresh button) it doesnt.

Am i doing something wrong here?

Merge file:

<pages>
  <page id="ProjectPage">
    <panels>
		<panel id="Project">
		  <cards>
			<card id="ProjectArchives">
			  <views>
				<view id="ProjectActivityBillingArchiveView" type="SoView" soprotocol="activityybillingarchive" rendermode="display">
				  <caption>Facturatie</caption>
				  <tooltip></tooltip>
				  <controlgroups>
					<controlgroup id="ProjectActivityBillingArchiveControlGroup" type="SoControlGroup" position="absolute" top="0px" bottom="0px" left="0px" right="0px" zindex="99">
					  <controls>
						<control id="ProjectActivityBillingArchive" type="SoArchiveControl" width="100%" top="0px" left="0px" height="100%" position="absolute" >
						  <menu>
							<context>archive</context>
							<subcontext>projectactivity</subcontext>
							<id binding="none">0</id>
							<position>belowcursor</position>
							<click>right</click>
						  </menu>
						  <config>
							<excluded-stylehints>sale,person,contact</excluded-stylehints>
							<toolbar>
							  <button caption="[SR_MB_ADD]" tooltip="[SR_MB_ADD_TOOLTIP]"
								   icon="Images/SmallIcon/Add.png"
								   iconselected="Images/SmallIcon/Add.png"
								   iconhover="Images/SmallIcon/Add.png"
								   icondisabled="Images/SmallIcon/Add_disabled.png"
								   onclick="javascript:OpenActivityDialog();"
								   dataright="create"
								>
								<sentry-rights>
								  <sentry-right tableright="HasInsert" type="disable">appointment</sentry-right>
								</sentry-rights>
							  </button>
							  <button caption="[SR_MB_DELETE]"
									  tooltip="[SR_MB_DELETE_TOOLTIP]"
									  icon="Images/SmallIcon/Delete.png"
									  iconselected="Images/SmallIcon/Delete.png"
									  iconhover="Images/SmallIcon/Delete.png"
									  icondisabled="Images/SmallIcon/Delete_disabled.png"
									  disabled="true"
									  dataright="delete"
									  onrowselect="DisableOnEmpty"
									  linkhint="nav=deleteActivity"
								/>
							  <button caption="[SR_MB_FILTER]"
							  tooltip="{filter_id=0}"
							  tooltip-binding="dynamic"
							  icon="Images/SmallIcon/Filter.png"
							  iconhover="Images/SmallIcon/Filter.png"
							  linkhint="nav=filterActivity"
							  fieldright="C"/>
							</toolbar>
							<restrictions>
							  <restriction name="projectId" operator="=" binding="current">project</restriction>
							  <restriction name="type" operator="in" active="true">1252,1253,1254,1255,1256,1257,1268,1269,1288,1272,36</restriction>
							</restrictions>
							<restriction-mappings>
							  <restriction-mapping source="appointment_id" target="appointmentId"/>"
							  <restriction-mapping source="sale_id" target="saleId"/>"
							  <restriction-mapping source="document_id" target="documentId"/>"
							</restriction-mappings>
							<dynamic-filter-excludes>
							  <dynamic-filter-exclude columnname="type"/>
							  <dynamic-filter-exclude columnname="text"/>
							</dynamic-filter-excludes>
							<enable-dynamic-filter>true</enable-dynamic-filter>
							<providername>projectactivity</providername>
							<archivecolumninfo-datasourcename>ArchiveColumnConfigDataHandler.ProjectActivityArchive</archivecolumninfo-datasourcename>
							<showheader>true</showheader>
							<showtoolbar>true</showtoolbar>
							<showexportbutton>true</showexportbutton>
							<defaultsort>date</defaultsort>
							<linkhint-prefix>norefresh:</linkhint-prefix>
							<togglerow-linkinfo>toggleactivities</togglerow-linkinfo>
							<indextype>LinkHint</indextype>
							<dblclick-action>
							  <sentry-rights>
								<sentry-right tableright="HasInsert" type="hide">appointment</sentry-right>
							  </sentry-rights>OpenActivityDialog();</dblclick-action>
						  </config>
						</control>
					  </controls>
					</controlgroup>
				  </controlgroups>
				  <triggers>
					<trigger type="current">project</trigger>
					<trigger type="current">appointment</trigger>
					<trigger type="current">sale</trigger>
					<trigger type="current">document</trigger>
					<trigger type="current">tzlocation</trigger>
				  </triggers>
				</view>
			  </views>
			</card>
		  </cards>
		</panel>
	</panels>
  </page>
</pages>

Related question: is there way to set fixed columns? i found topic's talking about how to do it in CRM Win, but that doesn't seem to work in WEB

SO Version: SuperOffice 8.1 Build Release81_C-2017.10.17-03

RE: Custom ProjectActivity Archive

Hi David,

 

You will  not be able to do this with the projectactivity provider, you have to create your own projectactivity provider to do this.  

The type restriction will probably search in the mailing table , any other restriction should work.

One workaround I found is to create a Udef  replica of the activitytype and set it during the save by using CRM script or database trigger.

If you set the restriction on Udef activitytype in you custom archive, it works like expected.

 

 

Af: Mehmet Canavar 6. nov 2017

RE: Custom ProjectActivity Archive

Hi David, 

For the appointment type restriction, instead of Type, have you tried the rawType column instead. 

Unfortunately the documentType doesn't seem to be available from this archive provider, so like Memhet suggests, you may have to create your own or come up with an alternative solution.

Best regards! 

Af: Tony Yates 6. nov 2017

RE: Custom ProjectActivity Archive

Hi Mehmet and Tony,

Thanks for your response.

I have changed the provider to only show appointments for now, which works correctly (using findappointment instead of projectactivity)

I'm still looking for an answer on my second question, is there a way to set the columns in an web archive provider?

Thanks,

David.

Af: David Hollegien 6. nov 2017

RE: Custom ProjectActivity Archive

Hi David, 

Yes, you can use the same procedure as the windows client. The config file is App_Data\WebClient\Web\ArchiveControl folder.

Once users open the clients, however, these column configurations - and customizations (via the configure columns dialog) are persisted in the database. To force a reset of columns, you need to delete these records from the database (SUPERLISTCOLUMNSIZE table - where listOwner is the name of the provider)

Hope this helps!

  

Af: Tony Yates 6. nov 2017

RE: Custom ProjectActivity Archive

Hi David,

For the default columns you have to use the "SoArchiveColumnList.config"  and add the available columns section with the option "default" I think, with the reset option in the configure columns dialog you can reset to the default columns for the archive.

 

Af: Mehmet Canavar 6. nov 2017

RE: Custom ProjectActivity Archive

Until we can resolve the overlapping column key issues in complex combined providers, I tend to suggest this:

Set up a seperate custom archive per entity and use the find providers.
i.o.w. not activity but findappointment, finddocument. Or ever just the base provider used in activity e.g appointment, document.

Then the Type column key becomes unambiguous.
I know this works well in Win with the Named Filter control system.
Conrad

Af: Conrad Weyns 6. nov 2017

RE: Custom ProjectActivity Archive

Hi,

Thanks for all the responses :-)

I got it working using the following approach:

SoArchiveColumnList.merge

<archives>
    <archive providername="projectactivity" guiname="projectactivitybillingarchive" mergeaction="insert">
		<columns>
			<column name="completed" default="true"  />
			<column name="date" default="true" orderby="1:D" />
			<column name="type" default="true" />
			<column name="text" default="true" />
			<column name="contact/nameDepartment" />
			<column name="person/fullName" default="true" />
			<column name="associate/assocName" default="true" />
			<column name="appointmentUdef/SuperOffice:2" default="true" /> <!-- Akkoord facturatie -->
			<column name="appointmentUdef/SuperOffice:1" default="true" /> <!-- Gefactureerd -->
			<column name="appointmentUdef/SuperOffice:4" default="true" /> <!-- Niet factureren -->
			<column name="appointmentUdef/SuperOffice:3" default="true" /> <!-- Status -->
			<column name="appointmentUdef/SuperOffice:5" default="true" /> <!-- Factuurnr -->
		</columns>
  </archive>
</archives>

As I understand it, because i reference the projectactivity here as providername, the archive inherits all its columns?

 

SoProjectPanel.merge

<pages>
	<page id="ProjectPage">
		<data>
			<datahandlers>
				<datahandler id="ArchiveColumnConfigDataHandler" type="ArchiveColumnConfigDataHandler" mergeaction="replace">
				  <config>
					<archivecolumninfos>
						<archivecolumninfo guiname="ProjectMemberArchive" providername="projectmember"/>
						<archivecolumninfo guiname="ProjectActivityArchive" providername="projectactivity"/>
						<archivecolumninfo guiname="ProjectSaleArchive" providername="salefiltered"/>
						<archivecolumninfo guiname="ProjectMailingsArchive" providername="mailings"/>
						<archivecolumninfo guiname="ProjectLeftGuide" providername="projectguideappointment"/>
						<archivecolumninfo guiname="ProjectRightGuide" providername="projectguidedocument"/>
						<archivecolumninfo guiname="projectactivitybillingarchive" providername="projectactivity" />
					</archivecolumninfos>
				  </config>
				</datahandler>
			</datahandlers>
		</data>
		<panels>
			<panel id="Project">
			  <cards>
				<card id="ProjectArchives">
				  <views>
					<view id="ProjectActivityBillingArchiveView" type="SoView" soprotocol="activitybillingarchive" rendermode="display" mergeaction="insert">
					  <caption>Facturatie</caption>
					  <tooltip></tooltip>
					  <controlgroups>
						<controlgroup id="ProjectActivityBillingArchiveControlGroup" type="SoControlGroup" position="absolute" top="0px" bottom="0px" left="0px" right="0px" zindex="99">
						  <controls>
							<control id="ProjectActivityBillingArchive" type="SoArchiveControl" width="100%" top="0px" left="0px" height="100%" position="absolute" >
							  <menu>
								<context>archive</context>
								<subcontext>projectactivity</subcontext>
								<id binding="none">0</id>
								<position>belowcursor</position>
								<click>right</click>
							  </menu>
							  <config>
								<excluded-stylehints>sale,person,contact</excluded-stylehints>
								<toolbar>
								  <button caption="[SR_MB_ADD]" tooltip="[SR_MB_ADD_TOOLTIP]"
									   icon="Images/SmallIcon/Add.png"
									   iconselected="Images/SmallIcon/Add.png"
									   iconhover="Images/SmallIcon/Add.png"
									   icondisabled="Images/SmallIcon/Add_disabled.png"
									   onclick="javascript:OpenActivityDialog();"
									   dataright="create"
									>
									<sentry-rights>
									  <sentry-right tableright="HasInsert" type="disable">appointment</sentry-right>
									</sentry-rights>
								  </button>
								  <button caption="[SR_MB_DELETE]"
										  tooltip="[SR_MB_DELETE_TOOLTIP]"
										  icon="Images/SmallIcon/Delete.png"
										  iconselected="Images/SmallIcon/Delete.png"
										  iconhover="Images/SmallIcon/Delete.png"
										  icondisabled="Images/SmallIcon/Delete_disabled.png"
										  disabled="true"
										  dataright="delete"
										  onrowselect="DisableOnEmpty"
										  linkhint="nav=deleteActivity"
									/>
								  <button caption="[SR_MB_FILTER]"
								  tooltip="{filter_id=0}"
								  tooltip-binding="dynamic"
								  icon="Images/SmallIcon/Filter.png"
								  iconhover="Images/SmallIcon/Filter.png"
								  linkhint="nav=filterActivity"
								  fieldright="C"/>
								</toolbar>
								<restrictions>
								  <restriction name="projectId" operator="=" binding="current">project</restriction>
								  <restriction name="type" operator="in" active="true">1252,1253,1254,1255,1256,1257,1268,1269,1288,1272</restriction>
								</restrictions>
								<restriction-mappings>
								  <restriction-mapping source="appointment_id" target="appointmentId"/>"
								  <restriction-mapping source="sale_id" target="saleId"/>"
								  <restriction-mapping source="document_id" target="documentId"/>"
								</restriction-mappings>
								<dynamic-filter-excludes>
								  <dynamic-filter-exclude columnname="type"/>
								  <dynamic-filter-exclude columnname="text"/>
								</dynamic-filter-excludes>
								<enable-dynamic-filter>true</enable-dynamic-filter>
								<providername>findappointment</providername>
								<archivecolumninfo-datasourcename>ArchiveColumnConfigDataHandler.projectactivitybillingarchive</archivecolumninfo-datasourcename>
								<showheader>true</showheader>
								<showtoolbar>true</showtoolbar>
								<showexportbutton>true</showexportbutton>
								<defaultsort>date</defaultsort>
								<linkhint-prefix>norefresh:</linkhint-prefix>
								<togglerow-linkinfo>toggleactivities</togglerow-linkinfo>
								<indextype>LinkHint</indextype>
								<dblclick-action>
								  <sentry-rights>
									<sentry-right tableright="HasInsert" type="hide">appointment</sentry-right>
								  </sentry-rights>OpenActivityDialog();</dblclick-action>
							  </config>
							</control>
						  </controls>
						</controlgroup>
					  </controlgroups>
					  <triggers>
						<trigger type="current">project</trigger>
						<trigger type="current">appointment</trigger>
						<trigger type="current">sale</trigger>
						<trigger type="current">document</trigger>
						<trigger type="current">tzlocation</trigger>
					  </triggers>
					</view>
				  </views>
				</card>
			  </cards>
			</panel>
		</panels>
	</page>
</pages>

I got a few minor issues here:

* I cant merge only the one line I need ("<archivecolumninfo guiname="projectactivitybillingarchive" providername="projectactivity" />") for the datahandler (I get a duplicate key error), so i replace the whole section.

* the archive still shows the "Mailings", "Documents" etc checkboxes, How do I remove those?

* Is there a way to set the default columnSize?

 

Thanks for the help so far!

Af: David Hollegien 10. nov 2017

RE: Custom ProjectActivity Archive

Hello,

Would be great to get answers to the two questions above, so that we can finish these archive providers :)

Thanks.

Af: David Hollegien 14. nov 2017

RE: Custom ProjectActivity Archive

Hi David,

Specifying which archive to use it one thing, it's the guiname that is key for column definitions. You do not inherit column settings based on the provider as you might think. The combination of provider name and gui name are used in identifiers, then stored in the superlistcolumnsize table for each users use.

With merge files, you only have to include the skeleton structure up to the element you wish to include. Insert is default, so it's not actually necessary to specify it.  See the Merge Actions section in the Customization and Deployment article.

The duplicate key thing... well do you have CacheConfigurations set to false in your ClientConfigurationProvider settings (web.config) while you develop? This might be why, or the file exists in two locations the application searchs during initialization? Somehow that combination already exists, or is persisted in the database. Use a ?flush to purge the caches.

There are no easy ways to remove the default provider entities that generate the checkboxes. Some people have used javascript to do it, but it's supported and not a configuration settings.

Best regards.

Af: Tony Yates 15. nov 2017

RE: Custom ProjectActivity Archive

Hi Tony,

Thanks for your response!

With merge files, you only have to include the skeleton structure up to the element you wish to include. Insert is default, so it's not actually necessary to specify it.  See the Merge Actions section in the Customization and Deployment article.
Thanks for the tip!

The duplicate key thing... well do you have CacheConfigurations set to false in your ClientConfigurationProvider settings (web.config) while you develop? This might be why, or the file exists in two locations the application searchs during initialization? Somehow that combination already exists, or is persisted in the database. Use a ?flush to purge the caches.I have CacheConfiguration to false when creating archive providers, also flushed multiple times, but i kept getting the duplicate key error.

There are no easy ways to remove the default provider entities that generate the checkboxes. Some people have used javascript to do it, but it's supported and not a configuration settings.Okay, will leave them there for now then.

Only question i have left is about the columns widths, is there a way to set them to a default value?

Thanks,

David

Af: David Hollegien 15. nov 2017