Desktop and UI Extensibility

Get Involved. Join the Conversation.

Comments

  • Bishnu Paudel

    Hi Uma,

    It is possible via CPM. You can put below code in your process designer and test it. It captures and prints   Cc email address which can be used to update any contact thereafter. 

    NOTE: if you get an unexpected result, try changing the index of threads from 0 to 1 or 2  .

    <?
    /*
     * CPMObjectEventHandler: CaptureCC
     * Package: RN
     * Objects: Incident
     * Actions: Create
     * Version: 1.2
     */
    use \RightNow\Connect\v1_2 as RNCPHP;

    use \RightNow\CPM\v1 as RNCPM;

    class CaptureCC
            implements RNCPM\ObjectEventHandler
    {
        public static function apply( $run_mode, $action, $obj, $n_cycles )
        {
            $mailHeader=$obj->Threads[0]->MailHeader;
            $startPos=strpos($mailHeader,"CC:") +3; // example CC: Bishnu<paudel_bishnu@email.com>, Anna
        <Anna@email.com>
            $endPos=strpos($mailHeader,">",$startPos); // look for  last occurrence of ">" character starting from $startPos in the header string
        
            echo substr($mailHeader,$startPos,($endPos-$startPos )); //outputs Bishnu<paudel_bishnu@email.com>, Anna
        <Anna@email.com>
            return;
        }
    }
     class CaptureCC_TestHarness
            implements RNCPM\ObjectEventHandler_TestHarness
    {
         static $inc = NULL;
         public static function setup()
         {
             $incident_id="130202-000077";
             $incident = RNCPHP\Incident::fetch($incident_id);
             static::$inc = $incident;
             return;
         }
       
        public static function
             fetchObject( $action, $object_type )
        {
             return(static::$inc);
         }
         public static function
         validate( $action, $object )
         {
             // Add one note.
             $status=true;
             return $status;
         }
         public static function cleanup()
         {        return;     }
    }

     

     

    Thanks,

  • Bastiaan van der Kooij

    the Incident Record is only available once the workspace is loaded, so you have to do this;

    RecordContext.DataLoaded += RecordContext_DataLoaded;

    private void RecordContext_DataLoaded(object sender, EventArgs e)
    {
      Incident = RecordContext.GetWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Incident) as IIncident;
    }

  • Shiv Tenneti

    Hi Cosimo,

    Here's the downloadable code. Please use this for learning purposes only and let me know if you have any questions.

    Shiv

  • Anurag Mittal

    Here is the code that will help you in setting customfileds and status:

                IIncident incidentRecord = _recordContext.GetWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Incident) as IIncident;

                    IList<ICfVal> incidentCustomFields = incidentRecord.CustomField;

                    foreach (ICfVal val in incidentCustomFields) // Get all custom field
                    {
                        if (val.CfId == 203) // Look for specific custom field
                        {
                            val.ValStr = text; // set the value
                            break;
                        }
                    }

    incidentRecord.Status.StatusID = 2; // set status

     

  • Barrilito van Dijk

    Hi Annelize,

    You are using a capitol C.

    You should do this with a lowercase "c":

    var Gender = c.GetCustomFieldByName("c$ClientGender");

    And next you should use the columname of your field, so you should do this:

    var Gender = c.GetCustomFieldByName("c$client_gender");

    And free tip of the day: why are you using a text field for a gender? Next to male, female or something inbetween I can't think of more options, perhaps better to use menu types for such items.

    Good luck!

    Regards

     

     

  • Alanna Larson

    If you are using a workspace add-in, the IChatRecordContext.MessagePosted event will inform you whenever a chat message is sent or received. For example,

    //cast your RecordContext as an IChatRecordContext
    _chatRecordContext = (IChatRecordContext)recordContext;
    //call your function (below) when the event fires
    _chatRecordContext.MessagePosted += this.MessagePosted;
    ...
    private void MessagePosted(object sender, ChatMessagePostedEventArgs e)
    {
    //do whatever you need to do when a chat message is received or sent
    //if you only care about messages sent by the customer, you can filter for messages like so:
    if(e.Message.Sender.Role == ChatEngagementRole.END_USER){ //do something here }
    }

  • Deepu Kolkkadan

    Hi Heena,

    Thank you, Its working. I got what I need.I made some changes in my parent workflow as per your parent workflow, Now its working fine.I attached the two workflows with this post.

     

    Heena & MB: Thank you very much for your time and consideration.

    Deepu

  • Robert Surujbhan

    Hi Mary! Per Scott’s earlier comment, when the ‘+’ plus symbol is encoded using %2B, the report will see the filter's value with the true ‘+’ character.  However, when the ‘+’ is passed explicitly in the URL, the report will see it as a space.

    So, if your screen pop CTI integration will be truly passing the explicit ‘+’ symbol, the following should work for you now.  It’s similar to my earlier recommendation – you just need to concatenate a space in front instead!  Let us know?

    concat(' ', contacts.any_phone_raw)
    
  • vijay kalidasan

    Hi ALL,

    Before implementing the above code , please check for incident contains any mail thread and apply the logic. Please refer the code below

    <?
    /*
     * CPMObjectEventHandler: CaptureCC
     * Package: RN
     * Objects: Incident
     * Actions: Create
     * Version: 1.2
     */
    use \RightNow\Connect\v1_2 as RNCPHP;

    use \RightNow\CPM\v1 as RNCPM;

    class CaptureCC
            implements RNCPM\ObjectEventHandler
    {
        public static function apply( $run_mode, $action, $incident, $cycle )
        {
             if ($cycle !== 0) return;
             
         
            if (RNCPM\ActionCreate == $action)
            {
              
               $f_count = count($incident->Threads);
               if($f_count > 0)
               {
               $mailHeader=$incident->Threads[0]->MailHeader;
               $startPos=strpos($mailHeader,"Cc:") +3;
               $endPos=strpos($mailHeader,"Content-Type:",$startPos);
               $ccmailaddress=substr($mailHeader,$startPos,($endPos-$startPos ));
             
               }
               else
               {
               $ccmailaddress="no value";
               }
            
                if ($ccmailaddress)
                {
                $incident->CustomFields->c->bccemail = $ccmailaddress;
                $incident->save();
                }
                
            }
        
          
            
            
        }
    }
     class CaptureCC_TestHarness
            implements RNCPM\ObjectEventHandler_TestHarness
    {
         static $incidentoneid = NULL;
         public static function setup()
         {
             $incidentone = new RNCPHP\incident;
             $incidentone->Subject="test1";
             $queryResult = RNCPHP\ROQL::queryObject("SELECT Contact FROM Contact WHERE Emails.Address = 'vijayreddy8317@gmail.com' AND Emails.AddressType = 0")->next();
            $incidentone->PrimaryContact = $queryResult->next();
            
             $incidentone->save();
             self::$incidentoneid = $incidentone->ID;
            
         }
       
        public static function
             fetchObject( $action, $object_type )
        {
            $incidentone = $object_type::fetch(self::$incidentoneid);
            return $incidentone;
         }
         public static function
         validate( $action, $object )
         {
            return true;
             
         }
         public static function cleanup()
         {   
            return;
         }
    }

     

    It works fine for my case. Request you to change header substr value based on your header information.

  • Scott Harwell

    You can use the AddinViewsDataFactory class to create objects of the type that you need...

    var thread = RightNow.AddIns.AddInViews.AddInViewsDataFactory.Create<IThread>();
    
  • Bastiaan van der Kooij

    Hey Dietrik,

    GlobalContext.GetOptlist(MenuID)

    The MenuID you can find in the Customizable Menu's if the CO is set to generate a menu, just hover over it to check the ID

    Bastiaan

  • Dietrik

    Please don't spam this forum with your commercial messages

  • Suresh Thirukoti
    This is very common issue and most of the times it can be resolved by adding Usercontrol dock style as fill...sometimes autosize also resolves.. http://stackoverflow.com/questions/10871565/how-to-make-winforms-usercontrol-fill-the-size-of-its-container ~Suresh
  • Narendra Muttineni

    This problem will be occurred when the console gets closed improperly. You must be logout the console and log back in, then the Add-In will be appear. When the console closed without proper login and when you log back in, the Add-ins may not be loaded properly. This is already existing drawback in the product.  So, if you want to overcome the issue, the only way is, you have to logout and log back in the console so that all the add-ins will be properly loaded.

    Regards,

    Narendra

  • Dietrik

    As the email address should bee returned:

    SELECT Incident.PrimaryContact.ParentContact.Emails.EmailList.Address FROM Incident