Scripting the uninstall/removal of a component

Hi,

I planned to script the removal of the component. I think I could script my manual component removal actions to another component '<Component>-Uninstaller' and can distribute to the clients.

I started removing the translations by examining the actual component that was scripted as:

FamilyType='Choices';
Family='cliv_popup';
Code='Person';
CaptOrder=1;
Captions['UK']='Person';
AddCaption();

Then I deleted the specified translation from "Administration -> Customization -> Translations".

When I reviewed the '<Component-Uninstaller> script it was the same as the installer component script:

FamilyType='Choices';
Family='cliv_popup';
Code='Person';
CaptOrder=1;
Captions['UK']='Person';
AddCaption();

Getting confused. If I am doing something wrong?

Can I create an uninstaller component at all?

UPDATE:

1) I am using Sage CRM 7.2.b right now.

2) When I looked into the Custom_Caption it turned to me that my manual delete action didn't remove the record altogether. It just marked the Capt_Deleted column = 1.

3) Upon re-installing the component the Component Manager is not reverting the Capt_Deleted column back to NULL. So how would the re-install work?

Regards,

  • 0

    Hi,

    Please if someone from Sage development community could address this issue?

  • 0

    Hi Jeff,

    Thanks for your reply.

    I read this article already and making the uninstall steps accordingly.

    However my questions are:

    1) Can we script the uninstall actions in another component to distribute to the client? Please check above that the installer and uninstaller scripts are being generated as same.

    2) Can we re-install the component? Please see point 2 and 3 in update section in my first post.

  • 0

    Hi Jeff,

    Can you please specify for my easiness that which of the following uninstall tasks could be scripted as a component?

    1. Translations that have been added or updated

    2. Workflows that have been added or updated

    3. Reports that have been added or updated

    4. Table level scripts that have been added or updated

    5. Container Block items that have been added or updated

    6. Tab groups that have been added or updated

    7. Fields on screens that have been added or updated

    8. Lists/Grids that have been added or updated

    9. Screen Objects that have been added or updated

    10. Columns that have been added or updated

    11. Views that have been added or updated

    12. Tables that have been added or updated

    13. Database links that have been added or updated

    Thanks.

  • 0

    Kal

    When a component is installed you need to understand that the component makes changes that are of two broad types.

    Firstly it may copy files like an ASP page or a dll into the system folders. The API for the component manager includes methods that allow copying of a file but not the removal of files.

    Secondly it makes changes to the meta data. Meta data is simply rows within tables in the database. A new record may be inserted, and an existing record maybe changed. As these changes take place no audit trail is kept of the previous value in the record. This means that removing a 'change' becomes a moot point. You can not undo a change when you no longer have a record of the previous value.

    So what do you do? This depends basically boils down to the methods available in the component API which allow you to rewrite the fields on screen and the tab options within a tab group.

    See: community.sagecrm.com/.../Default_CSH.htm

    and specifically

    community.sagecrm.com/.../Default_CSH.htm

    These are the delete/drop methods described in the documentation

    DeleteCustom_Caption

    DeleteCustom_Captions

    DeleteCustom_Field

    DeleteCustom_Screen

    DeleteCustom_ScreenObjects

    DropTable

    DropView

    DropConstraint

  • 0

    Hi Jeff,

    Thanks for your reply.

    One quick question. As I experienced that I can't script (for e.g.) Delete_Caption method automatically. I have to add manually in the script fie. Does it mean all of the delete commands can only be coded manually in the script file?