Customer Portal

Get Involved. Join the Conversation.

Topic

    Srinath Srinivasan
    Ability to view secondary contact's incident upon...
    Topic posted October 3, 2017 by Srinath SrinivasanGreen Ribbon: 100+ Points 
    1428 Views, 31 Comments
    Title:
    Ability to view secondary contact's incident upon logging into customer portal
    Content:

    Hi Geeks,

    Can you kindly help me out with the below requirement,

     

     A contact after logging  in to the CP page  should be able to view the incidents where they are marked as primary contact

    and they should also be able to view the incidents where they are marked as secondary contact

    is there any way to do this?

    Your help in this would be much appreciated.

    Comment

    • Carl Elliott

      You would have to create a custom report using the inc2contacts table joined to Contacts and joined to incidents. Pass the Contact ID as a filter on the contact table and that should pull all the incidents for a contact where the contact is primary or secondary.  Then display that report in the portal.   

    • Srinath Srinivasan
      Carl Elliott said:

      You would have to create a custom report using the inc2contacts table joined to Contacts and joined to incidents. Pass the Contact ID as a filter on the contact table and that should pull all the incidents for a contact where the contact is primary or secondary.  Then display that report in the portal.   

      View original

      Hi Carl,

      Thanks for the response, as far as the report is concerned, its working like a charm based on your advise, however after passing the report Id to the customer portal page, its showing the incidents which are once again pertaining to the primary contact only. Please find attached the document which has the filter description and the customer portal view for your kind perusal

    • Suresh Thirukoti

      I think its due to the fact that a filter is automatically added of your contact details whenever you login to CP portal ...so you need to override Report model method "addContactinformation()" ...for more info



      https://cloudcustomerconnect.oracle.com/posts/49ef926b8d



      ~Suresh

    • Pramod Vasudeva Murthy

      Well, I have the report and once I pass the filter I view results in AD but not in CP. I checked the filter all seem right but no luck.

      ~VIP

    • Gursimran Singh Saini

      Just view?
      Make a report using logic given by Carl then call it using ConnectPHP API.
      Yes, you can also call it using Widgets (Grid/Multiline) but that'll require change in some standard Models. Too much effort. Make your own Widget.

      If you wish to make Incident editable by Secondary Contacts, you need to:

      - Extend Incident.PHP Model (using extensions file)
      - Override method isContactAllowedToReadIncident (Add a logic to allow both Primary and Secondary Contacts to view/update Incidents)

    • Pramod Vasudeva Murthy

      Isn't there a config setting to it? Like enable this switch and secondary contacts can also update the Incident?

      ~VIP

    • Pramod Vasudeva Murthy

      By extension file,

      do you mean info.yml file?

      Can you please provide the syntax to extend a custom model which is an extension of standard/Incident.php?

      ~VIP

    • Suresh Thirukoti

      @Pramod -  I have done this some time back and steps are included in the below URL...



      https://cloudcustomerconnect.oracle.com/posts/49ef926b8d



      ~Suresh

    • Suresh Thirukoti

      You need to extend the Standard Model Report by mentioning in the extensions.yml 

      //in extentions.yml file the code is
       extensions.yml
      modelExtensions:
      Report: ExtendReport

      In the custom model ExtendReport, write as below

      <?php
      namespace Custom\Models;
      class ExtendReport extends \RightNow\Models\Report
      {
          function __construct()
          {
              parent::__construct();
          }

       protected function addContactInformation($contactDataSet, $searchArgs, $index = 0)
          {
              return $searchArgs; 
          }
      }

    • Gursimran Singh Saini
      Pramod Vasudeva Murthy said:

      Isn't there a config setting to it? Like enable this switch and secondary contacts can also update the Incident?

      ~VIP

      View original

      Na. But we could make one!

      Far as I know, there's only a config of Org View. (0, 1, 2)

    • Gursimran Singh Saini
      Pramod Vasudeva Murthy said:

      By extension file,

      do you mean info.yml file?

      Can you please provide the syntax to extend a custom model which is an extension of standard/Incident.php?

      ~VIP

      View original

      No no. extensions.yml in Config folder.

      See that file. There are some comments on how to work on it.

      Just add a line like so:
      Incident: ExtendedIncident

      Now CP will call your ExtendedIncident Model everywhere.

    • Pramod Vasudeva Murthy

      Okay,

      I have done following so far,

      In my extensions.yml I have added them:

      modelExtensions:
      Incident: ExtendedIncident
      Report: ExtendReport

      and have created relevant custom models and created them in Custom/models folder:

      ExtendedIncident.PHP

      -------------------------------------------------------------------------------

      <?php

      namespace Custom\Models;
      use RightNow\Connect\v1_3 as RNCPHP;
       
      class ExtendedIncident extends \RightNow\Models\Incident
      {
      protected function addContactInformation($contactDataSet, $searchArgs, $index = 0)
          {
              return $searchArgs; 
          }
      }
      ?>
       
      ExtendedReport.php

      -------------------------------------------------------------------------------

      <?php
      namespace Custom\Models;
       
      class ExtendReport extends \RightNow\Models\Report
      {
      function __construct()
          {
              parent::__construct();
          }
       
      protected function addContactInformation($contactDataSet, $searchArgs, $index = 0)
          {
              return $searchArgs; 
          }  
      }
      ?>
       
      But dont see anything updated. Am I missing something? extensions are new to me please suggest.
       
      ~VIP
    • Pramod Vasudeva Murthy

      Two questions:

      • I don't see the method you specify in this link. Where did you view this method -addContactInformation()?
      • What is the significance of this method addContactInformation()?

      ~VIP

    • Pramod Vasudeva Murthy

      Okay,

      I tried above suggestions and seems not to work. Looks like *whole* customisation is the only option.

      Any suggestions?

      ~VIP

    • Gursimran Singh Saini

      - New Widget to call Incident Report.

      - ExtendedIncident Model and override isContactAllowedToReadIncident method.