Handling article parts using the SDK
 
This topic explains how to handle article parts using the Artcl object of the SDK. It will give you details about how to consult, insert, update or delete the article parts of the currently selected article.
 
Following are the steps you should take to handle the articles parts of the articles of your Venice installation.
 
PrepareParts
This method allows you to securely prepare the current article (managed by the Artcl object) for handling its article parts, without user interface.

You state the action you want to execute by providing the correct value for the parameter ePreparePartsAction:
ppaView You only want the consult the data of the article parts.
ppaModify You want to insert new article parts or modify or delete existing article parts.

After this method is called, all existing article parts of the current article will be available for consultation or modification.
 
Handling the actual parts
Following methods are available for handling the actual article part data:

ePreparePartsAction   Method   Description
ppaView and ppaModify   GetPart   Retrieve the data of the given article part.
ppaView and ppaModify   GetNumParts   Retrieve the number of article parts.
ppaModify   InsertPartSel   Insert a new article part.
ppaModify   UpdatePartSel   Update an existing article part.
ppaModify   DeletePart   Delete an existing article part.
 
WriteParts or CancelParts
The final step is to save the provided article part data to disk using the WriteParts method or cancel the preparations using the CancelParts method.

Remark:
Make sure that this step is always executed, especially in situations where an exception is thrown, by providing accurate error handling!
 
Remarks:
If you are modifying the article parts (ePreparePartsAction is set to ppaModify), this method will lock the article card until the WriteParts or the CancelParts method is called.
During the period of time between calling the PrepareParts method and the WriteParts method or the CancelParts method, your application will use up 1 Import-user, except when the PrepareParts method was called using the value 'ppaView' for the parameter ePreparePartsAction.
Therefore, the option 'Import' must be installed in order to modify article parts in the SDK.
The default (English) prefixes for the article numbers, available in Venice, are also provided for use in the article parts.
Valid prefixes are 'n:' (number), 'a:' (alias), 'b:' (bar code) and 'd:' (description).
For more information on the use of these prefixes, you should consult the help of your Venice installation.