Comments

  • 1-7 of 7
  • Tushar Gupta

    Instead of using Lookupname use ID attribute like:

    $md->Encoding->ID = 1

    ID 1 is default which is for hashing

  • Tushar Gupta

    Try this:

    In define replace NameOfTheInterface with your site name and change the framework version too.

    define('CPCORE','/cgi-bin/NameOfTheInterface.cfg/scripts/cp/core/framework/3.7.2/');
    require_once( CPCORE . 'Libraries/....');
    use \RightNow\Libraries\.....;

  • Tushar Gupta

    I think this would have worked for you:

    date_default_timezone_set();      //Ex: date_default_timezone_set('Asia/Kolkata');
    date('Y-m-d H:i:s');

  • Tushar Gupta
    Allan Schrum said:

    Using a service reference within the Add-In framework requires you to manually do some of the initialization that would be found in app.config. The Add-In framework provides some assistance in this area. A snippet of code I've used to do this is as follows:

                //get the soap service endpoint
                EndpointAddress endPointAddr = new EndpointAddress(_globalContext.GetInterfaceServiceUrl(ConnectServiceType.Soap));

                //Minimum required
                BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
                binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;

                // Optional depending upon what you are doing
                binding.MaxReceivedMessageSize = 1024 * 1024;
                binding.MaxBufferSize = 1024 * 1024;
                // binding.MessageEncoding = WSMessageEncoding.Mtom;

                // Create client proxy class
                _client = new RightNowSyncPortClient(binding, endPointAddr);

                // Credentials for username/password
                //Don't use for PrepareConnectSession. It uses Session only.
                // _client.ClientCredentials.UserName.UserName = "admin";
                // _client.ClientCredentials.UserName.Password = "";

                // Ask the client to not send the timestamp
                BindingElementCollection elements = _client.Endpoint.Binding.CreateBindingElements();
                elements.Find<SecurityBindingElement>().IncludeTimestamp = false;
                _client.Endpoint.Binding = new CustomBinding(elements);

                // Ask the Add-In framework the handle the session logic instead of username/password
                _globalContext.PrepareConnectSession(_client.ChannelFactory);

                // Go do what you need to do!
                ClientInfoHeader cih = new ClientInfoHeader();
                cih.AppID = "SAML Test";

                MetaDataClass[] my_metadata = _client.GetMetaData(cih);

    If your user (account) has the correct profile permissions, then your Add-in can use the session-based information associated with their active session in the console. In that situation, use the "PrepareConnectSession" method. If you want to use a fixed username/password, then uncomment the lines above setting the ClientCredentials and do not call "PrepareConnectSession".

    Regards,

    -Allan
     

    View original

    This really saved me a lot of time. Thanks a lot

  • Tushar Gupta

    Yes, I agree with Ammar.

  • Tushar Gupta

    Probably date_default_timezone_set() which can be used to set timezone you want.

  • Tushar Gupta

    Join two tables Milestone Instances and Incident and use Due Date field from milestone table.

    This way you will get the resolution due date of Incidents in report.