Integrations and APIs for Service

Get Involved. Join the Conversation.

Posts

  • David Brenchley
    ROQL case insensitive search5.0
    Topic posted October 9, 2012 by David Brenchley 
    Title:
    ROQL case insensitive search
    Content:

    How do I do a case insensitive search with ROQL?  I've tried such things as below and they don't work

     

    SELECT Contact FROM Contact WHERE ToLower(Login) LIKE '" + login.ToLower() + "'

    SELECT Contact FROM Contact WHERE Lower(Login) LIKE '" + login.ToLower() + "'

    SELECT Contact FROM Contact WHERE ToUpper(Login) LIKE '" + login.ToUpper() + "'

    SELECT Contact FROM Contact WHERE Upper(Login) LIKE '" + login.ToUpper() + "'

     

    Code Snippet:
  • Jordan Hoff
    Create, Update and Delete actions on StandardContent not...5.0
    Topic posted August 3, 2012 by Jordan HoffRed Ribbon: 250+ Points 
    Title:
    Create, Update and Delete actions on StandardContent not reflected in Agent desktop
    Content:

    I'm trying to automate some maintenance on StandardContent. When I add new StandardContent objects, make changes to things like DisplayOrder, or destroy them, the changes are reflected in the database, but there seems to be some caching at the agent desktop level. I have to manually go in and make a change to one object in order to see the new objects and/or changes to sort order.

    How can I envoke a cache refresh of some sort, or disable this caching feature all together? It kinda defeats the purpose of being able to do CRUD operations on StandardContent, if the agents can never see the changes.

    Thanks.

    Version:
    November 2011
  • JustRhianna
    Cannot update phone fields using connect for PHP5.0
    Topic posted June 28, 2012 by JustRhiannaSilver Crown: 22,500+ Points 
    Title:
    Cannot update phone fields using connect for PHP
    Content:

    We’ve encountered a problem updating Contact phone records from the
    Connect for PHP API. Identically structured code succeeds elsewhere (updating
    names / emails / custom fields). For phones, the operation appears to succeed
    (no error is thrown, introspecting the Contact object after save shows the
    fields properly updated), yet the changes are not propagated to the database.
    Has any other developer encountered a similar problem?”

     

    The relevant code:

     

        private function getPhone($existingPhone, $index,
    $number) {
            $phone = new RNCP\Phone();
    
            if
    (!$existingPhone->Number && $number != "Null") {
               
    $phone->action = 'add';
            } elseif
    ($existingPhone->Number && $number == "Null") {
               
    $phone->action = 'remove';
            } else {
    
               
    $phone->action = 'update';
            }
    
            if ($number !=
    "Null") {
                $phone->Number
    = html_entity_decode(urldecode($number), ENT_QUOTES);
            } else {
    
               
    $phone->Number = "";
            }
    
            $phone->PhoneType = new
    RNCP\NamedIDOptList();
            $phone->PhoneType->ID =
    $index;
            return $phone;
    
        }
    
     
        public function setMyPhones($id, $office, $mobile,
    $fax, $alt, $home) {
     
            $this->checkContact($id);
    
            $numbers = array($office,
    $mobile, $fax, $alt, $home);
            for ($index = 0; $index <
    count($numbers); $index++) {
               
    $this->contact->Phones[$index] =
    $this->getPhone($this->contact->Phones[$index], $index,
    $numbers[$index]);
            }
    
           
    $this->contact->save(RNCP\RNObject::SuppressAll);
            RNCP\ConnectAPI::commit();
    
        }
    
  • bluephlame
    Date of Birth Field, for people older then 425.0
    Topic posted March 22, 2012 by bluephlame Blue Ribbon: 750+ Points 
    Title:
    Date of Birth Field, for people older then 42
    Content:

    Hi,


    I am looking for away of creating a date field that will be able to record dates older then 1/1/1970.


    This discussion here talks about it.


    https://cloudcustomerconnect.oracle.com/posts/cf582596d7


    We talked about it with our account manager, and ridiculous amounts of money were being dicussed.  Just wondering if anyone out there has nocked up a custom add-in to solve this problem and if they could post it here.


    If not I'm going to whack one up and share it with the community. (trust me the cost associated with this was ridiculous compared to how easy the problem is to solve.)


    Is there a standard spot somewhere that we could keep things like add-ins and widgets that are helpful for each other?  


     

  • Chris Omland
    Query Custom Objects Video5.0
    Topic posted March 8, 2011 by Chris OmlandBronze Crown: 15,000+ Points 
    Title:
    Query Custom Objects Video
    Content:

    I put together a short instructional video on how to build ROQL queries for custom objects. You can find the video here: http://www.rightnow.com/devblog/2011/03/query-custom-objects-with-roql/

    Thanks!

  • Ryan McCullough
    Example Code: Moving a contact from one organization to...5.0
    Topic posted October 9, 2008 by Ryan McCulloughSilver Crown: 22,500+ Points 
    Title:
    Example Code: Moving a contact from one organization to another
    Content:

    Here is example code for moving a contact from one organization to another.

    Java:

    // the contact id
    int OldConId = 1;
    // create a new contact object with the ID
    RNOWContact OldCon = new RNOWContact(OldConId);
    // get the contact
    OF.get(OldCon);
    // the new organization id that the contact will be moved to
    int NewOrgId = 2;
    // create the new contact
    RNOWContact NewCon = new RNOWContact();
    // assign the new organization id to the new contact
    NewCon.setOrgID(NewOrgId);
    // copy the data from the old contact
    if (OldCon.getAddrCity() != null)
        NewCon.setAddrCity(OldCon.getAddrCity());
    if (OldCon.getAddrCountryID() != null)
        NewCon.setAddrCountryID(OldCon.getAddrCountryID());
    if (OldCon.getAddrPostalCode() != null)
        NewCon.setAddrPostalCode(OldCon.getAddrPostalCode());
    if (OldCon.getAddrProvID() != null)
        NewCon.setAddrProvID(OldCon.getAddrProvID());
    if (OldCon.getAddrStreet() != null)
        NewCon.setAddrStreet(OldCon.getAddrStreet());
    if (OldCon.getAltNameFirst() != null)
        NewCon.setAltNameFirst(OldCon.getAltNameFirst());
    if (OldCon.getAltNameLast() != null)
        NewCon.setAltNameLast(OldCon.getAltNameLast());
    if (OldCon.getAnsNotif() != null)
        NewCon.setAnsNotif(OldCon.getAnsNotif());
    if (OldCon.getBanner() != null)
        NewCon.setBanner(OldCon.getBanner());
    if (OldCon.getCat() != null)
        NewCon.setCat(OldCon.getCat());
    if (OldCon.getCategoryNotif() != null)
        NewCon.setCategoryNotif(OldCon.getCategoryNotif());
    if (OldCon.getContactListIDs() != null)
        NewCon.setContactListIDs(OldCon.getContactListIDs());
    if (OldCon.getCTypeID() != null)
        NewCon.setCTypeID(OldCon.getCTypeID());
    if (OldCon.getCustomField() != null)
        NewCon.setCustomField(OldCon.getCustomField());
    if (OldCon.getDisabled() != null)
        NewCon.setDisabled(OldCon.getDisabled());
    if (OldCon.getEEFlag() != null)
        NewCon.setEEFlag(OldCon.getEEFlag());
    if (OldCon.getEmailAddr() != null)
        NewCon.setEmailAddr(OldCon.getEmailAddr());
    if (OldCon.getEmailCert() != null)
        NewCon.setEmailCert(OldCon.getEmailCert());
    if (OldCon.getEmailInvalid() != null)
        NewCon.setEmailInvalid(OldCon.getEmailInvalid());
    if (OldCon.getEmailAlt1Addr() != null)
    {
        NewCon.setEmailAlt1Addr(OldCon.getEmailAlt1Addr());
        if (OldCon.getEmailAlt1Cert() != null)
            NewCon.setEmailAlt1Cert(OldCon.getEmailAlt1Cert());
        if (OldCon.getEmailAlt1Invalid() != null)
            NewCon.setEmailAlt1Invalid(OldCon.getEmailAlt1Invalid());
    }
    if (OldCon.getEmailAlt2Addr() != null)
    {
        NewCon.setEmailAlt2Addr(OldCon.getEmailAlt2Addr());
        if (OldCon.getEmailAlt2Cert() != null)
            NewCon.setEmailAlt2Cert(OldCon.getEmailAlt2Cert());
        if (OldCon.getEmailAlt2Invalid() != null)
            NewCon.setEmailAlt2Invalid(OldCon.getEmailAlt2Invalid());
    }
    if (OldCon.getFAttach() != null)
        NewCon.setFAttach(OldCon.getFAttach());
    if (OldCon.getLinesPerPage() != null)
        NewCon.setLinesPerPage(OldCon.getLinesPerPage());
    if (OldCon.getLogin() != null)
        NewCon.setLogin(OldCon.getLogin());
    if (OldCon.getMaAltOrgName() != null)
        NewCon.setMaAltOrgName(OldCon.getMaAltOrgName());
    if (OldCon.getMaMailType() != null)
        NewCon.setMaMailType(OldCon.getMaMailType());
    if (OldCon.getMaOptIn() != null)
        NewCon.setMaOptIn(OldCon.getMaOptIn());
    if (OldCon.getMaOrgName() != null)
        NewCon.setMaOrgName(OldCon.getMaOrgName());
    if (OldCon.getNameFirst() != null)
        NewCon.setNameFirst(OldCon.getNameFirst());
    if (OldCon.getNameLast() != null)
        NewCon.setNameLast(OldCon.getNameLast());
    if (OldCon.getNote() != null)
        NewCon.setNote(OldCon.getNote());
    if (OldCon.getPassword() != null)
        NewCon.setPassword(OldCon.getPassword());
    if (OldCon.getPhAsst() != null)
        NewCon.setPhAsst(OldCon.getPhAsst());
    if (OldCon.getPhAsstRaw() != null)
        NewCon.setPhAsstRaw(OldCon.getPhAsstRaw());
    if (OldCon.getPhFax() != null)
        NewCon.setPhFax(OldCon.getPhFax());
    if (OldCon.getPhHome() != null)
        NewCon.setPhHome(OldCon.getPhHome());
    if (OldCon.getPhHomeRaw() != null)
        NewCon.setPhHomeRaw(OldCon.getPhHomeRaw());
    if (OldCon.getPhMobile() != null)
        NewCon.setPhMobile(OldCon.getPhMobile());
    if (OldCon.getPhMobileRaw() != null)
        NewCon.setPhMobileRaw(OldCon.getPhMobileRaw());
    if (OldCon.getPhOffice() != null)
        NewCon.setPhOffice(OldCon.getPhOffice());
    if (OldCon.getPhOfficeRaw() != null)
        NewCon.setPhOfficeRaw(OldCon.getPhOfficeRaw());
    if (OldCon.getProd() != null)
        NewCon.setProd(OldCon.getProd());
    if (OldCon.getProductNotif() != null)
        NewCon.setProductNotif(OldCon.getProductNotif());
    if (OldCon.getSalesAcctID() != null)
        NewCon.setSalesAcctID(OldCon.getSalesAcctID());
    if (OldCon.getSearchText() != null)
        NewCon.setSearchText(OldCon.getSearchText());
    if (OldCon.getSearchType() != null)
        NewCon.setSearchType(OldCon.getSearchType());
    if (OldCon.getSource() != null)
        NewCon.setSourceUpd(OldCon.getSource()); // make sure to copy source, not source_upd
    if (OldCon.getState() != null)
        NewCon.setState(OldCon.getState());
    if (OldCon.getSurveyOptIn() != null)
        NewCon.setSurveyOptIn(OldCon.getSurveyOptIn());
    if (OldCon.getTitle() != null)
        NewCon.setTitle(OldCon.getTitle());
    if (OldCon.getUpdatedBy() != null)
        NewCon.setUpdatedBy(OldCon.getUpdatedBy());
    if (OldCon.getWorkflowFlag() != null)
        NewCon.setWorkflowFlag(OldCon.getWorkflowFlag());
    int iOldConDelete = 0;
    int iNewConId = 0;
    // batch the delete and create so that if there is an issue both requests are rolled back
    OF.BeginTransaction();
    // delete the old contact
    iOldConDelete = OF.delete(OldCon);
    // calling BeginTransaction() again, ensures that the delete is performed before the create
    OF.BeginTransaction();
    // create the new contact
    iNewConId = OF.create(NewCon);
    try
    {
        // submit the batched request
        Object[][] BatchResult = OF.Submit();
        // get the delete & create result
        if (BatchResult != null && BatchResult.length > 1)
        {
            if (BatchResult[0][0] != null)
                iOldConDelete = Integer.parseInt(BatchResult[0][0].toString());
            if (BatchResult[1][0] != null)
                iNewConId = Integer.parseInt(BatchResult[1][0].toString());
        }
        System.out.println("Delete the old contact: " + iOldConDelete);
        System.out.println("Create the new contact: " + iNewConId);
        if (iNewConId > 0)
        {
            // get the new contact to verify the organization id
            NewCon = new RNOWContact(iNewConId);
            OF.get(NewCon);
            System.out.println("New Contact Organization ID: " + NewCon.getOrgID());
            System.out.println("New Contact Email Address: " + NewCon.getEmailAddr());
            System.out.println("New Contact Login: " + NewCon.getLogin());
        }
        else
        {
            System.out.println("The contact create was not successful. (return id " + iNewConId + ")");
        }
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
    

    C#:
    // declare the object factory
    RNOWObjectFactory OF = new RNOWObjectFactory("https://server/cgi-bin/interface.cfg/php/xml_api/soap_api.php");
     
    // the contact id
    int OldConId = 1;
     
    // create a new contact object with the ID
    RNOWContact OldCon = new RNOWContact(OldConId);
     
    // get the contact
    OF.get(OldCon);
     
    // the new organization id that the contact will be moved to
    int NewOrgId = 2;
     
    // create the new contact
    RNOWContact NewCon = new RNOWContact();
     
    // assign the new organization id to the new contact
    NewCon.OrgID = NewOrgId;
     
    // copy the data from the old contact
    if (OldCon.AddrCity != null) NewCon.AddrCity = OldCon.AddrCity;
    if (OldCon.AddrCountryID != null) NewCon.AddrCountryID = OldCon.AddrCountryID;
    if (OldCon.AddrPostalCode != null) NewCon.AddrPostalCode = OldCon.AddrPostalCode;
    if (OldCon.AddrProvID != null) NewCon.AddrProvID = OldCon.AddrProvID;
    if (OldCon.AddrStreet != null) NewCon.AddrStreet = OldCon.AddrStreet;
    if (OldCon.AltNameFirst != null) NewCon.AltNameFirst = OldCon.AltNameFirst;
    if (OldCon.AltNameLast != null) NewCon.AltNameLast = OldCon.AltNameLast;
    if (OldCon.AnsNotif != null && OldCon.AnsNotif.Count > 0) NewCon.AnsNotif = OldCon.AnsNotif;
    if (OldCon.Banner != null) NewCon.Banner = OldCon.Banner;
    if (OldCon.Cat != null) NewCon.Cat = OldCon.Cat;
    if (OldCon.CategoryNotif != null) NewCon.CategoryNotif = OldCon.CategoryNotif;
    if (OldCon.ContactListIDs != null) NewCon.ContactListIDs = OldCon.ContactListIDs;
    if (OldCon.CTypeID != null) NewCon.CTypeID = OldCon.CTypeID;
    if (OldCon.CustomField != null) NewCon.CustomField = OldCon.CustomField;
    NewCon.Disabled = OldCon.Disabled;
    NewCon.EEFlag = OldCon.EEFlag;
    if (OldCon.EmailAddr != null) NewCon.EmailAddr = OldCon.EmailAddr;
    if (OldCon.EmailCert != null) NewCon.EmailCert = OldCon.EmailCert;
    NewCon.EmailInvalid = OldCon.EmailInvalid;
    if (OldCon.EmailAlt1Addr != null) NewCon.EmailAlt1Addr = OldCon.EmailAlt1Addr;
    if (OldCon.EmailAlt1Cert != null) NewCon.EmailAlt1Cert = OldCon.EmailAlt1Cert;
    NewCon.EmailAlt1Invalid = OldCon.EmailAlt1Invalid;
    if (OldCon.EmailAlt2Addr != null) NewCon.EmailAlt2Addr = OldCon.EmailAlt2Addr;
    if (OldCon.EmailAlt2Cert != null) NewCon.EmailAlt2Cert = OldCon.EmailAlt2Cert;
    NewCon.EmailAlt2Invalid = OldCon.EmailAlt2Invalid;
    if (OldCon.FAttach != null) NewCon.FAttach = OldCon.FAttach;
    if (OldCon.LinesPerPage != null) NewCon.LinesPerPage = OldCon.LinesPerPage;
    if (OldCon.Login != null) NewCon.Login = OldCon.Login;
    if (OldCon.MaAltOrgName != null) NewCon.MaAltOrgName = OldCon.MaAltOrgName;
    if (OldCon.MaMailType != null) NewCon.MaMailType = OldCon.MaMailType;
    if (OldCon.MaOptIn != null) NewCon.MaOptIn = OldCon.MaOptIn;
    if (OldCon.MaOrgName != null) NewCon.MaOrgName = OldCon.MaOrgName;
    if (OldCon.NameFirst != null) NewCon.NameFirst = OldCon.NameFirst;
    if (OldCon.NameLast != null) NewCon.NameLast = OldCon.NameLast;
    if (OldCon.Note != null) NewCon.Note = OldCon.Note;
    if (OldCon.Password != null) NewCon.Password = OldCon.Password;
    if (OldCon.PhAsst != null) NewCon.PhAsst = OldCon.PhAsst;
    if (OldCon.PhAsstRaw != null) NewCon.PhAsstRaw = OldCon.PhAsstRaw;
    if (OldCon.PhFax != null) NewCon.PhFax = OldCon.PhFax;
    if (OldCon.PhHome != null) NewCon.PhHome = OldCon.PhHome;
    if (OldCon.PhHomeRaw != null) NewCon.PhHomeRaw = OldCon.PhHomeRaw;
    if (OldCon.PhMobile != null) NewCon.PhMobile = OldCon.PhMobile;
    if (OldCon.PhMobileRaw != null) NewCon.PhMobileRaw = OldCon.PhMobileRaw;
    if (OldCon.PhOffice != null) NewCon.PhOffice = OldCon.PhOffice;
    if (OldCon.PhOfficeRaw != null) NewCon.PhOfficeRaw = OldCon.PhOfficeRaw;
    if (OldCon.Prod != null) NewCon.Prod = OldCon.Prod;
    if (OldCon.ProductNotif != null) NewCon.ProductNotif = OldCon.ProductNotif;
    if (OldCon.SalesAcctID != null) NewCon.SalesAcctID = OldCon.SalesAcctID;
    if (OldCon.SearchText != null) NewCon.SearchText = OldCon.SearchText;
    if (OldCon.SearchType != null) NewCon.SearchType = OldCon.SearchType;
    if (OldCon.Source != null) NewCon.SourceUpd = OldCon.Source;
     
    // make sure to copy source, not source_upd
    if (OldCon.State != null) NewCon.State = OldCon.State;
    if (OldCon.SurveyOptIn != null) NewCon.SurveyOptIn = OldCon.SurveyOptIn;
    if (OldCon.Title != null) NewCon.Title = OldCon.Title;
    if (OldCon.UpdatedBy != null) NewCon.UpdatedBy = OldCon.UpdatedBy;
    NewCon.WorkflowFlag = OldCon.WorkflowFlag;
    int iOldConDelete = 0;
    int iNewConId = 0;
     
    // batch the delete and create so that if there is an issue both requests are rolled back
    OF.BeginTransaction();
     
    // delete the old contact
    iOldConDelete = OF.delete(OldCon);
     
    // calling BeginTransaction() again, ensures that the delete is performed before the create
    OF.BeginTransaction();
     
    // create the new contact
    iNewConId = OF.create(NewCon);
    try
    {
        // submit the batched request
        object[][] BatchResult = OF.Submit();
     
        // get the delete & create result
        if (BatchResult != null && BatchResult.Length > 1)
        {
            if (BatchResult[0][0] != null) iOldConDelete = (int)BatchResult[0][0];
            if (BatchResult[1][0] != null) iNewConId = (int)BatchResult[1][0];
        } Console.WriteLine("Delete the old contact: " + iOldConDelete);
        Console.WriteLine("Create the new contact: " + iNewConId);
        if (iNewConId > 0)
        {
            // get the new contact to verify the organization id NewCon = new RNOWContact(iNewConId);
            OF.get(NewCon);
            Console.WriteLine("New Contact Organization ID: " + NewCon.OrgID);
            Console.WriteLine("New Contact Email Address: " + NewCon.EmailAddr);
            Console.WriteLine("New Contact Login: " + NewCon.Login);
        }
        else
        {
            Console.WriteLine("The contact create was not successful. (return id " + iNewConId + ")");
        }
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message + Environment.NewLine + e.StackTrace);
    }

  • Ryan McCullough
    Example Code: Assigned field on RNOWIncident and...5.0
    Topic posted September 2, 2008 by Ryan McCulloughSilver Crown: 22,500+ Points 
    Title:
    Example Code: Assigned field on RNOWIncident and RNOWOpportunity
    Content:

    When setting the Assigned field of an RNOWIncident or RNOWOpportunity, the subject (RNOWIncident) or name (RNOWOpportunity) must be a string with a length > 0. Here is some example code for Java and .NET that demonstrates how to safely set the assigned field.

    Java:

    int IncidentId = 1;
    RNOWIncident Inc = new RNOWIncident(IncidentId);
    OF.get(Inc);
    if (Inc.getSubject() != null && Inc.getSubject().length() > 0)
    {
        RNOWGroupAcct Acct = new RNOWGroupAcct();
        Acct.setAcctID(18);
        Acct.setGroupID(100128);
        Inc.setAssigned(Acct);
        OF.update(Inc);
    }
    
    int OpportunityId = 1;
    RNOWOpportunity Opp = new RNOWOpportunity(OpportunityId);
    OF.get(Opp);
    if (Opp.getName() != null && Opp.getName().length() > 0)
    {
        RNOWLvlChainDn LvlChain = new RNOWLvlChainDn();
        Vector<Integer> Chain = new Vector<Integer>();
        Chain.add(17);
        Chain.add(14);
        LvlChain.setChain(Chain);
        LvlChain.setChainID(14);
        Opp.setAssigned(LvlChain);
        OF.update(Opp);
    }
    

    C#:

    int IncidentId = 1;
    RNOWIncident Inc = new RNOWIncident(IncidentId);
    OF.get(Inc);
    if (Inc.Subject.Length > 0) {
        RNOWGroupAcct Acct = new RNOWGroupAcct();
        Acct.AcctID = 18;
        Acct.GroupID= 100128;
        Inc.Assigned = Acct;
        OF.update(Inc);
    }
    
    int OpportunityId = 1;
    RNOWOpportunity Opp = new RNOWOpportunity(OpportunityId);
    OF.get(Opp);
    if (Opp.Name.Length > 0) {
        RNOWLvlChainDn LvlChain = new RNOWLvlChainDn();
        List<int?> Chain = new List<int?>();
        Chain.Add(17);
        Chain.Add(14);
        LvlChain.Chain = Chain;
        LvlChain.ChainID = 14;
        Opp.Assigned = LvlChain;
        OF.update(Opp);
    }
    
  • ryszard antonczyk
    Does RNTConnect provide the functionality based on user...5.0
    Topic posted February 24, 2009 by ryszard antonczykBronze Trophy: 5,000+ Points 
    Title:
    Does RNTConnect provide the functionality based on user profile settings within the console?
    Content:

    Recently this question was raised and we felt that the developer community could benefit from this information. 

     

    As of now RN Connect Data Integration does not provide ability to access user's profiles. Therefore it is either full access or no access at all. However, as a work-around, in your integration application you could write your own code to restrict some users from certain operations. 

     

    If you feel it is important for your organization to have such functionality exposed by RN Connect – please contact your Account Manager.

     

Filter by Date

< < December 2019 > >
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

Filter by Type