Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On Demand Webinar: See Why Thousands of QlikView Users Have Switched to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Deleting document cals Automatically

Hi,

Our client has a requirement to delete the document CALS automatically from QEMC.

For Ex: We have 20 Document CALS assigned and 20 users assigned for a document. But one user has last logged in 15 days back and they want to delete the user without manual intervention and assign that to a new user who will be using the Document. Similarly in a certain time period if the user is not logged on then that Document CAL should be free. Any automatic way for this?

Thanks in Advance.

2 Replies
markodonovan
Specialist
Specialist

Hi Uma,

If you are happy with .NET development have a look into the QMS interface.

Also you could see if there is anything in the QlikView Power Tools that would help.

Thanks

Mark

http://techstuffybooks.com

// Here is some code that might give you a start:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Diagnostics;

namespace cal_manager

{

    class Program

    {

        

        static void Main(string[] args)

        {

          //Console.WriteLine("Document CAL Manager");

         qms_interface edx_int = new qms_interface();

         //command - list \ delete 

         //doc

         if(args.Length>=2)

         {

           string doc_command = args[0];

           string doc_folder = args[1];

           string doc_name = args[2];

                switch(doc_command)

                {

                    //Delete document cals older than 24 hours old

                    case "removeall":

                    case "delete":

                        {

                            Console.WriteLine("The following document cals have been deleted:");

                            Console.WriteLine("docs = " + edx_int.check_document_cals(doc_command, doc_name).ToString());

                        }

                        break;

                    //List document cals

                    case "list":

                        {

                            Console.WriteLine("list of document cals over 24 hours old:"+doc_name);

                            Console.WriteLine("docs = " + edx_int.check_document_cals(doc_command,doc_name).ToString());

                        }

                        break;

                    //Check the current doc cal usage

                    case "manage":

                        //parameters: mange docname free_cal threshold cal_change

                        {//string doc_name,  int cal_threshold, int cal_change)

                            if (args.Length == 6)

                            {

                                int free_cal_threshold = int.Parse(args[3]);

                                int cal_change = int.Parse(args[4]);

                                int max_cal_allocation = int.Parse(args[5]);

                                Console.WriteLine("manage document cals assigned:" + doc_name);

                                Console.WriteLine("docs = " + edx_int.manage_document_cals(doc_folder, doc_name, free_cal_threshold, cal_change,max_cal_allocation).ToString());                               

                            }

                            else

                            {

                                Console.WriteLine("Not enough parameters");

                            }

                        }

                        break;

                }

          }

          else

          {

                    Console.WriteLine("Not enough parameters");

          }

         //Console.WriteLine("Please Enter to continue");      

         //Console.ReadLine();

        }

        //Create a log for this application in the windows event log

        public static void log_message(String log_message)

        {

            string sSource;

            string sLog;

            string sEvent;

            sSource = "CAL Management App";

            sLog = "Application";

            sEvent = log_message;

            if (!EventLog.SourceExists(sSource))

                EventLog.CreateEventSource(sSource, sLog);

            EventLog.WriteEntry(sSource, sEvent);

            //EventLog.WriteEntry(sSource, sEvent,

            //    EventLogEntryType.Warning, 234);

        }

    }

}

mohamed_ahid
Partner
Partner

Hi

Have a look here :

Qlikview Server CAL Manager