Comments (18)
Please do composer update
- you're using an outdated edge. This issue should have been fixed earlier.
from php-crm-toolkit.
ok.
let me try.
then i will tell you.
from php-crm-toolkit.
Still Same error
from php-crm-toolkit.
@ekhlascyblance please provide the full error message again.
from php-crm-toolkit.
already provided
from php-crm-toolkit.
@ekhlascyblance please provide the code that you use to employ the library. It would help a lot.
from php-crm-toolkit.
function __construct( Settings $settings, CacheInterface $cache = null, LoggerInterface $logger = null ) {
try {
// Create settings object
$this->settings = $settings;
// Inject CacheInterface implementation
$this->cache = $cache;
// Inject LoggerInterface implementation
$this->logger = $logger;
/* If either mandatory parameter is NULL, throw an Exception */
if ( !$this->checkConnectionSettings() ) {
switch ( $this->settings->authMode ) {
case "OnlineFederation":
throw new BadMethodCallException( get_class( $this ) . ' constructor requires Username and Password' );
case "Federation":
throw new BadMethodCallException( get_class( $this ) . ' constructor requires the Discovery URI, Username and Password' );
}
}
/* Create authentication class to connect to CRM Online or Internet facing deployment via ADFS */
switch ( $this->settings->authMode ) {
case "OnlineFederation":
$this->authentication = new OnlineFederation( $this->settings, $this );
break;
case "Federation":
$this->settings->loginUrl = $this->getFederationSecurityURI( 'organization' );
$this->authentication = new Federation( $this->settings, $this );
break;
}
$this->soapActions = new SoapActions( $this );
if ( !$this->settings->hasOrganizationData() ) {
$organizationDetails = $this->retrieveOrganization( $this->settings->serverUrl );
$this->settings->organizationId = $organizationDetails['OrganizationId'];
$this->settings->organizationName = $organizationDetails['FriendlyName'];
$this->settings->organizationUniqueName = $organizationDetails['UniqueName'];
$this->settings->organizationVersion = $organizationDetails['OrganizationVersion'];
}
/* Initialize the entity metadata instance */
MetadataCollection::instance( $this );
} catch ( Exception $e ) {
$this->logger->critical( 'Caught an exception while initializing PHP CRM Toolkit.', [ 'exception' => $e ] );
throw $e;
}
}
in /src/Client.php
from php-crm-toolkit.
My Client setting is as below.
http://prntscr.com/frvjyl
from php-crm-toolkit.
This is a listing of Client::__construct(), and I would like to see how you are using the library, e.g. including the autoloader, instantiating the client, making calls, etc.
from php-crm-toolkit.
@ekhlascyblance please change the required version in composer.json
- replace the php-crm-toolkit
version with dev-master
and do composer update
. You are using an outdated version at the moment.
from php-crm-toolkit.
you mean Like this
{
"require": {
"alexacrm/dev-master": "^1.1"
}
}
from php-crm-toolkit.
@ekhlascyblance no, please refer to Composer documentation.
Your composer.json
file would look like:
{
"require": {
"alexacrm/php-crm-toolkit": "dev-master"
}
}
Then hit the composer update
command.
from php-crm-toolkit.
ok .
let me try
from php-crm-toolkit.
Solved ..
But Got new error now
Class 'Cache' not found
I use below code Note : second Last line
require_once 'vendor/autoload.php';
use AlexaCRM\CRMToolkit\Client as OrganizationService;
use AlexaCRM\CRMToolkit\Settings;
$contactId = '1d2fc62f-1c56-448b-b546-edfb6d6fec5c';
$options = [
'serverUrl' => 'https://org.crmN.dynamics.com',
'username' => '[email protected]',
'password' => 'portalPassword',
'authMode' => 'OnlineFederation',
];
$serviceSettings = new Settings( $options );
$service = new OrganizationService( $serviceSettings );
// retrieve a contact and update its fields
$contact = $service->entity( 'contact', $guid );
$contact->firstname = explode( '@', $contact->emailaddress1 )[0];
$contact->update();
printf( 'Info for %s %s updated.', $contact->firstname, $contact->lastname );
// create a new contact
$contact = $service->entity( 'contact' );
$contact->firstname = 'John';
$contact->lastname = 'Doe';
$contact->emailaddress1 = '[email protected]';
$contactId = $contact->create();
// delete a contact
$contact->delete();
// execute an action
$whoAmIResponse = $service->executeAction( 'WhoAmI' );
echo 'Organization ID: ' . $whoAmIResponse->OrganizationId;
// inject cache repo
// must be instance of AlexaCRM\CRMToolkit\CacheInterface
$cacheRepo = Cache::instance();
$service = new Client( $serviceSettings, $cacheRepo );
from php-crm-toolkit.
@ekhlascyblance yes, about that - just don't provide a $cacheRepo
. Or you can alternatively implement CacheInterface
and provide your implementation. This library gives you freedom in this regard.
from php-crm-toolkit.
can you please give some example of that CacheInterface implementation.
if i am not wrong it will make response faster.
from php-crm-toolkit.
CacheInterface and StorageInterface are well documented, and the implementation is trivial. I'm afraid I can't provide you a working example at this time. Some examples may be seen here: https://github.com/AlexaCRM/integration-dynamics/blob/master/src/Cache.php
from php-crm-toolkit.
Ok
Thanks Bro.
You are really wizard for me
from php-crm-toolkit.
Related Issues (20)
- Create an email in Dynamics 365 using AlexaCRM php-crm-toolkit HOT 6
- Cannot use “contain-values” operate for multiselect optionsets attribute in FetchXML.
- Datetime type field fetch and not coming correct format HOT 1
- How to catch if the authentication failed HOT 1
- Get records by date or latest records not all HOT 1
- How to retrieve id from this data HOT 3
- Is there any way to fetch opportunities with lineitems HOT 1
- Uncaught exception 'Exception' with message 'Could not retrieve WSDL HOT 6
- Need sample code for pagination HOT 1
- How to create contact with php form on dynamics crm ? HOT 30
- Need Query on contact in crm and put condition on create or sending task to crm user HOT 1
- Error when authenticating: Ws-Trust HOT 22
- Oauth HOT 1
- Performance of creating a contact HOT 3
- Ws-Trust authentication has been deprecated HOT 1
- Create new or Update if exists HOT 1
- Integration broken because disco.crm.dynamics.com is returning 404 HOT 3
- How to authenticate Multi Server URLs Using one azure Application credentials. HOT 5
- Could not find ExecuteResult node in XML returned from Server Error HOT 1
- Exception deserializing entity
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-crm-toolkit.