General Technical Discussions for Service

Get Involved. Join the Conversation.

Comments

  • Anuj Behl

    Hi Eric,

    You can use a combination on RightNow's Business Rules and Mailings for your requirement.

    1. Create a Mailing template that you would like to send when contact is updated
    2. Create a Business Rule on contact
    • You can add an if condition to check if the contact's been updated through console or customer portal or to check whether a particular field has been modified in that edit
    • In the Then part, add a Send Marketing Mail action and select the previously created mailing template

     

    Tell me if it works for you

    - Anuj

  • Christopher Farmer

    Hi Alagappan,

    I'd just like to reiterate the thanks to you and Mark for this workaround. I was tearing my hair out for hours over this.

    Just to confirm to everyone, I was able to get the value of a contact custom field using ROQL instead of accessing Contact->CustomFields->c...

  • Andrew Rowse

    Hi Kevin,

    This might also be related to a commit issue + CPM's that I ran across last month when SP5 went out on 13.2.

    http://cxdeveloper.com/article/updated-sp5-cx-132-commit-bug-w-active-cpm

    An Oracle dev contacted me and was able to reproduce the issue. Sounded like they were working on a fix, but no news on when it would be implemented. In a way, what you are seeing sounds related in some way to the field access issues I was seeing.


    AR

  • Suresh Thirukoti


    Thanks varun for the quick response...... Also https://cloudcustomerconnect.oracle.com/posts/72a516af5c ...can you kindly review the solution and suggest any changes?

  • Varun Chandran

    Hi Suresh,

    If you are sending it to a Contact associated with RN, we have a standard functionality for it. You can use,

    RNCPHP\Mailing::SendMailingToContact(Contact, Incident_or_Opportunity, Mailing, ScheduledTime)

    Contact - Valid Contact object
    Incident_or_Opportunity - The Incident or Opportunity object that the mailing or survey should be sent for.
    Mailing - The id of the mailing that needs to be sent to the customer.
    ScheduledTime - The time at which the mailing needs to be sent out to the provided contact. This field needs to be in Unix Epoch time.

    Hope this helps.

    Regards,

    Varun

  • Scott Harwell

    If you omit the 5 lines above  $org->CustomFields->c->eligible_future_vacan = 0; then does that help?

    I think $org->CustomFields->c = new $md2->c->type_name; would need to be $org->CustomFields = new $md2->c->type_name; if you chose to instantiate the custom field object.  But, the organization object should have a CustomFields object since you are retrieving an existing record.  So, I think your assignment of a new custom fields object to $org->CustomFields->c is the cause of the issue.

  • Mark Bradley

    <?

    /*
    * CPMObjectEventHandler: progresscall_update
    * Package: CO2
    * Objects: CO2\ProgressCall
    * Actions: Update
    * Version: 1.0
    */

    // This object procedure binds to v1_2 of the Connect PHP API
    use \RightNow\Connect\v1_2 as RNCPHP;

    // This object procedure binds to the v1 interface of the process
    // designer
    use \RightNow\CPM\v1 as RNCPM;

    class progresscall_update
    implements RNCPM\ObjectEventHandler
    {
      public static function
      apply( $run_mode, $action, $obj, $n_cycles )
      {
        try
        {
          $org = RNCPHP\Organization::Fetch( $obj->Application1->Organization->ID );
          
          progresscall_update::sustainable_job_offer($obj, $org);
          
        }
        catch (Exception $err) {
          print_r($err->getCode());
          print_r($err->getMessage());
        }
        return;
      }
     
      public static function
      sustainable_job_offer($obj, $org)
      {
        $progcal_prev = $obj->prev;
        $sustainable_prev = $obj->prev->Sustainable;
        $sustainable_new = $obj->Sustainable;
            
        if (( $sustainable_new != $sustainable_prev) && ($sustainable_new == 1)) {
          try
          {
            $md = $org::getMetadata();
            $cf_type_name = $md->CustomFields->type_name;
            $md2 = $cf_type_name::getMetadata();
            $org->CustomFields->c = new $md2->c->type_name;
            
            $org->CustomFields->c->eligible_future_vacan = 0;
            $org->save(RNCPHP\RNObject::SuppressAll);
          }
          catch (Exception $err) {
            print_r($err->getCode());
            print_r($err->getMessage());
          }
        }
        return;
      }
    }

    /*
    The Test Harness
    */


    class progresscall_update_TestHarness
    implements RNCPM\ObjectEventHandler_TestHarness
    {
      static $progresscall_invented = NULL;

      public static function setup()
      {
        $progresscall = new RNCPHP\CO2\ProgressCall;
        $application = RNCPHP\CO\Application::Fetch(1);
        $vacancy = RNCPHP\CO\Vacancy::Fetch(91);

        $application->Vacancy = $vacancy;
       
        $progresscall->Application1 = $application;
        $progresscall->Sustainable = 2;

        static::$progresscall_invented = $progresscall;
        return;
      }

      public static function
      fetchObject( $action, $object_type )
      {
        return(static::$progresscall_invented);
      }

      public static function
      validate( $action, $object )
      {
        $progresscall_invented->Sustainable = 1;
        return(static::$progresscall_invented);
      }

      public static function cleanup()
      {    
        return;
      }
    }

  • Mark Rhoads

    Do you mind sharing with us (or just me via email) an export of the entire custom process, including all handlers/scripts and mappings (use the export feature of the Process Designer)?

  • Alagappan Dhakshinamoorthy

    Hi Kevin,

    I believe this was the way it is working from the initial release of custom processes.

    Thanks,

    Alagappan

  • Mark Bradley

    Thanks for the response.

    I dont think there is an update recursion here. I should have mentioned that the Custom Process is indeed an update but it is attached to a Custom Object and not to Organization. I tested the SupressAll regardless but unfortunately still no joy.

    Also, Ive checked the logs and there is nothing in them.

    Any other suggestions?

  • Mark Rhoads

    If this is attached to an update event then most likely the handler is failing because the save() is inducing update-event recursion.  The handler does not handle this recursion within the limit (a max depth of 5) and so it is failed.  There's probably some error messages in the info log.

    Instead, pass RNCPHP\RNObject::SuppressAll to the save() method, or have the handler test $n_cycles parameter on the apply() method.

     

  • Kevin Browne

    Hi Alagappan,

    Thanks to you (and to Mark) for the reply, much appreciated.  I have a quick followup question.  To your knowledge, is this the way it has worked all along with Custom Processes or was this changed at some point after the initial release of the Custom Processes feature.  I'm curious if we will see this with all versions of the product to-date.

    Thanks,

    Kevin

  • Alagappan Dhakshinamoorthy

    Hi Kevin,

    I am able to see 1 workaround for this behavior by following the steps below.

    1. Making a change on the contact object.

    2. Save the object.

    3. Then call ConnectAPI::rollback()

    4. Refetch the contact object and then try retrieve all the custom fields of the contact object.

    Thanks to Mark Rhoads for this workaround...

    Another workaround is to retrieve the required custom fields specifically using ROQL query as in the forum post you mentioned above.

    Regards

    Alagappan

     

     

     

     

  • bin xiong

    Oh, It is an internal site provide by others.

    Somebody mentioned I can do it through HMS, can I transfer to HMS from the admin URL?

  • Bhagwan Singh Mer

    No. You will have to reach out to Oracle.Is it a live site or demo instance?