We’ve developed some resources to help you work effectively from home during COVID-19 Click here to learn more

Custom archive, detail methods do not work

Hi,

I need to update a custom archive for SuperOffice Windows from version 7.1 to 8.2. While I got the custom archive to work, it does no longer call methods of Windows script to handle add, edit and delete events. Besides, if I click Add, I get the message "mainRowType is undefined for this archive!". Here my config file:

<?xml version="1.0" encoding="utf-8"?>
<archives>
	<!-- UDTSALEPOSITION: SaleUDTSALEPOSITION -->
	<archive providername="UDTSALEPOSITION" guiname="SaleUDTSALEPOSITION" hostname="SaleArchive">
		
		<custom
			mainRowType="UdtSaleposition"
			storagekey="SaleUDTSALEPOSITION"
			windowname="Verkaufspositionen"
			protocol="salepositions"
			editmethod="EditSalePosition"
			addmethod="AddSalePosition"
			deletemethod="DeleteSalePosition"
			contextmenumethod="OnDoSalePosition"
			tooltip="Positions of current sale">
		</custom>

		<!--
		<restrictions>
			<restriction name="UDTSALEPOSITIONId" operator="equals" active="true">
				<values>
					<value>&lt;cuid&gt;</value>
				</values>
			</restriction>
		</restrictions>
		-->

		<view columnspacer="false"
			  debugcolumns="true"
			  columnheader="true"
			  reconfigure="true"
			  fielddataviewer="true">
		</view>

		<toolbar add="true"
				 delete="true"
				 countinfo="true"
				 entities="false"
				 listboxlabel="Positions:">
		</toolbar>

		<colums>
			<column name="Produktnummer" default="true" withoverride="8%" />
			<column name="Produktname" default="true" withoverride="15%" />
			<column name="Gebinde" default="true" withoverride="8%" />
			<column name="Gebindetext" default="true" withoverride="15%" />
			<column name="Mengeinkg" default="true" withoverride="10%" />
			<column name="Lieferkondition" default="true" withoverride="8%" />
			<column name="Lieferort" default="true" withoverride="10%" />
			<column name="Waehrung" default="true" withoverride="8%" />
			<column name="Preis" default="true" withoverride="10%" />
			<column name="Preiseinheit" default="true" withoverride="8%" />
		</colums>

		<contextmenuitems>
		</contextmenuitems>
	</archive>
</archives>


Question: what do I have to set as a mainRowType? I tried class names of my provider and extender classes, without success.

In 7.1 I deployed a Windows script file to the script folder that implement the add, edit and delete methods. That worked fine. In 8.2 these methods are no longer called, even though the script is active and works. Windows scripts per se work fine in 8.2.

To upgrade the custom archive, I downloaded and installed Tony's DevNet Toolbox, generated the code for TableInfo, ArchiveProvider and Dictionary Steps. In order to update the meta information I applied the dictionary steps to the database. I modified the code of the custom archive (provider, extender) as required.

Ideas and hints are highly welcome.

Marc

RE: Custom archive, detail methods do not work

Hei Marc,

This is correct.
7.1 is a long time ago...
The script solution has been replaced with a much better IArchiveControlEventHandler system residing in the C# netserver domain.

Conrad 

Av: Conrad Weyns 2. jan 2018

RE: Custom archive, detail methods do not work

Hi Conrad,

can you give me an example of using the IArchiveControlEventHandler interface?

Thanks and best regards. Marc

Av: Marc Eberhard 3. jan 2018

RE: Custom archive, detail methods do not work

Hi Marc,

See the Custom Archive Providers-Controls.zip download from EW2011!

The presentation was recorded and is available for viewing here:

https://community.superoffice.com/en/video-center/video-player/custom-archives/

The discussion and walk-through of the IArchiveControlEventHandler interface begins at the 00:28:00 minute mark.

Best regards

Av: Tony Yates 3. jan 2018

RE: Custom archive, detail methods do not work

Hi Tony,

thanks for the hint. I also found your video which is very helpful. Is it sufficient to deploy the assembly implementing IArchiveControlEventHandler and refer it to in the <DynamicLoad> tag of SuperOffice.config or do I need to deploy other config files as well?

Marc

Av: Marc Eberhard 3. jan 2018

RE: Custom archive, detail methods do not work

Hi Marc,

As seen in the video, you still have to deploy the custom archive config file, same as before. It's just cleaner and delegates the methods and actions to the Interface. In the example download this is located under the CustomArchiveProvider project and called DummyRows.config. Rename it SoCrm Custom Archives.config and place it accordingly.

You do have to declare the dll in the superoffice.config files DynamicLoad section.

Hope this helps!

Av: Tony Yates 3. jan 2018

RE: Custom archive, detail methods do not work

Hi,
SoCrm Archives.config is reserved. Use anything else.

These can be removed from your configuration file:

editmethod="EditSalePosition"            addmethod="AddSalePosition"      deletemethod="DeleteSalePosition"            contextmenumethod="OnDoSalePosition"

add="true"
delete="true"

Let us know if you are having any issues. We'll help a.s.a.p!

/conrad

Av: Conrad Weyns 3. jan 2018

RE: Custom archive, detail methods do not work

Hi Conrad and Tony,

I took the DummyRows.config from Tony's sample and adapted to my stuff (which actually removes the methods as you said, Conrad), and implemented the IArchiveControlEventHandler interface in my archive provider assembly, so I need to deploy only one DLL. Now everything works fine, without scripting, just with the DLL and the config file. Very nice solution indeed :-)

Thanks for your prompt and invaluable help - without which I would never have got this to run in my life...

Marc

Av: Marc Eberhard 3. jan 2018

RE: Custom archive, detail methods do not work

Many thanks for the feedback, Marc.
Nice to hear!
Conrad

Av: Conrad Weyns 3. jan 2018