Comments (6)
executeAction
is for executing custom actions, it is not the Execute method that you are after. What you need to do is to build your own SOAP packet for AddListMembersListRequest. SoapRequestGenerator.php file already contains few requests, just follow the same flow.
The reason why we didn't build it is simply the volume. CRM has over 200 different requests, it wouldn't be feasible for us to try and cover all of them. We do encourage that people form the project and add new request types as needed.
You'd need to figure out the parameters, of course. Download CRM SDK (the latest downloadable version) and check out SoapLogger sample. It generates jscript but packets are all the same.
HTH
George
from php-crm-toolkit.
Thanks very much for the reply George.
I think I have the SOAP packet I need but I can't see how to send it. Should I use the "attemptSoapResponse()" function in Client.php? I did try playing around with it but not getting anywhere so far.
Also, I am struggling to see the actual XML response that is being sent to the server. I can see reference to a "$logger" in various parts of the library code but I can see no edocumentation on how to use it. Ist here a variable somewhere to set to get it to display messages or something similar?
I'd appreciate it if you are able to point me in the right direction with this.
Cheers,
Bill
from php-crm-toolkit.
Hi Bill,
actually, take a look at executeAction
in Client.php module. This is something that you'd model your request after.
- instead of
generateExecuteActionRequest
you'd want your customgenerateAddListMemberListRequest
where you do the SOAP formatting specific to that request - after you execute
loadXml
to get your response, you'd need to parse that response which will be serializedAddListMemberListResponse
(usually there is nothing to parse if it's successful but there maybe some IDs returned - check the docs for that response)
$logger is a generic logging interface that gets attached when client is constructed. Whatever is your favorite logger, really depends on the environment.
HTH
George
from php-crm-toolkit.
Hi George,
so I have made progress on this and thought it might be interesting to share where I have got to so far. I am now able to add one or more contact to a marketing list. I found that I can use executeAction from client.php but adding a few lines of code to handle a field type of "ArrayOfguid". The additions are generic and it made me wonder if this is something that could be included in the library. The code I added was as follows:
case 'arrayofguid': $xmlType = 'ArrayOfguid'; $entity = $xmlValue; $xmlTypeNS = 'http://schemas.microsoft.com/2003/10/Serialization/Arrays'; $entityValue = $executeActionRequestDOM->createElement('c:value'); foreach ( $entity as $contact_guid ) { $entityValue->appendChild($executeActionRequestDOM->createElement( 'd:guid', $contact_guid )); }; // end foreach $xmlValue = null; break;
I was then able to call exectueAction as follows:
$result = $service->executeAction( 'AddListMembersList', array( array('key'=>'ListId', 'value' => $listguid, 'type' => 'guid'), array('key'=>'MemberIds', 'value' => $memberids, 'type' => 'arrayofguid') ), 'AddListMembersListRequest' );
Cheers,
Bill
from php-crm-toolkit.
Hi Bill,
cool, that's great! Can you create a pull request for the AddListMembersList
implementation and we'll see what can be done about making it generic.
Thanks
George
from php-crm-toolkit.
Hi George
I have created a pull request with the changes I made to soaprequestsgenerator.php to handle the xml type "ArrayOfguid"
Cheers
Bill
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.