برای ثبت یک فرم توسط وب سرویس در CRM آیا باید اشخاص تعریف کرد

تعریف اشخاص اختیاری است
فرم میتواند مرتبط با یک فرد باشد و هم میتواند نباشد
دوست من لطفا ابتدا نمونه کد ها و مستندات رو کامل مطالعه کنید
جواب تمام سوالاتتان در این ها بوده
نمونه
https://github.com/1stco/PayamGostarApiSamples/blob/master/PHP/Person/SavePerson.php
اون رو چک کردم ولی خانم مشکانی گفتن که باید هویت ثبت بشه که میشه Identity ولی اون وب سرویس وب سرویس شخص بود نمی دونم اگر فرقی نداره و میشه شخص تعریف کرد و به فرم وصل کرد که پیامک برای آن شخص ارسال کنه همون کار رو بکنم
در ضمن تمامی سوالات که نه فقط اگر یکی هستن میشه گفت شخص و هویت میشه از این کد استفاده کرد در غیر این صورت برای ذخیره فرم به این صورتی که می گید نیست چون پارامتر ها متفاوت هستند و نوع آنها نیز متفاوت
$params = array(
'username' => $username,
'password' => $password,
'IdentityInfo' => array(
'IdentityType' => 'حقیقی',
'CrmObjectTypeCode' => 'HaghighiMokhatab',
'LastName' => 'احمدی',
'FirstName' => 'احمدی',
'ContactPhone' => array(
'ContactPhoneInfo' => array(
array(
'PhonePrefix' => '98',
'Phone' => '9122344867',
'PhoneType' => 'موبایل'
)
)
),
'IdentityCategory' => array(
'IdentityCategoryInfoArray' => array(
'Key' => 'PersonCustomerAudienceCRM'
)
)
)
);
بررسی می کنید نحوه ارسال رو چون همون خطا رو وب سرویس بر می گردونه
$params = array(
'username' => $username,
'password' => $password,
'IdentityInfo' => array(
...........................
بجای کلمه IdentityInfo
از Identity استفاده کنید و بعد لطفا نتیجه رو بگید
باز هم همون پیغام
+"SaveIdentityResult": {#3349
+"Message": "Object reference not set to an instance of an object.",
+"Success": false,
+"CrmId": "00000000-0000-0000-0000-000000000000",
},
}
بله بقیه وب سرویس ها مثل ثبت فرم و جستجو فرم کار می کند فقط این کار نمی کند
این بخش
'ContactPhone' => array(
'ContactPhoneInfo' => array(
array(
'PhonePrefix' => '98',
'Phone' => '9122344867',
رو از کدتون حذف کنید برای تست
فرقی نکرد باز همون خطا رو میده

تنها راهی که باقی میمونه شما با ابزار هایی مثل wcftestclient یا wcfteststorm داده های ورودی تون رو تست کنید و از صحت عملکرد وب سرویستون مطمعا شین
IdentityId رو باید از کجا بدست بیارم؟

identity id رو نمیخواد پاس بدید اون برای زمانیه که بخواهید یکی از هویت های موجود رو ویرایش کنید
<SaveIdentity>
<MethodParameters>
<username>Admin</username>
<password>@dmin</password>
<identity actualtype="IdentityInfo" basetype="IdentityInfo">
<AddressContacts attr0="IdentityContactAddressArray" isNull="false">
<IdentityContactAddressArray0>
<Address isNull="false" />
<AddressType isNull="false" />
<AreaCode isNull="false" />
<City isNull="false" />
<Country isNull="false" />
<State isNull="false" />
<ZipBox isNull="false" />
<ZipCode isNull="false" />
<Id>00000000-0000-0000-0000-000000000000</Id>
<IsDefault>False</IsDefault>
<IsDeleted>False</IsDeleted>
</IdentityContactAddressArray0>
</AddressContacts>
<Balance>0</Balance>
<Categories attr0="CategoryInfoArray" isNull="false">
<CategoryInfoArray0>
<Id>00000000-0000-0000-0000-000000000000</Id>
<IdentityId>00000000-0000-0000-0000-000000000000</IdentityId>
<IsDeleted>False</IsDeleted>
<Key>PersonCustomerAudienceCRM</Key>
<Name isNull="false" />
<Type isNull="false" />
</CategoryInfoArray0>
</Categories>
<Classification isNull="false" />
<ColorName isNull="false" />
<CustomerDate>3/14/2021 3:07:50 PM</CustomerDate>
<CustomerNumber isNull="false" />
<DontEmail>False</DontEmail>
<DontFax>False</DontFax>
<DontPhoneCall>False</DontPhoneCall>
<DontSms>False</DontSms>
<DontSocialSms>False</DontSocialSms>
<Emails attr0="StringArray" isNull="false">
<StringArray0 isNull="false" />
</Emails>
<IdentityType>حقیقی</IdentityType>
<NickName>kafaei</NickName>
<OtherUsername isNull="false" />
<PhoneContacts attr0="IdentityContactPhoneArray" isNull="false">
<IdentityContactPhoneArray0>
<ContinuedNumber isNull="false" />
<Extension isNull="false" />
<PhoneNumber>9122344867</PhoneNumber>
<PhoneType>موبایل</PhoneType>
<Id>00000000-0000-0000-0000-000000000000</Id>
<IsDefault>False</IsDefault>
<IsDeleted>False</IsDeleted>
</IdentityContactPhoneArray0>
</PhoneContacts>
<SaleUsername isNull="false" />
<SourceType isNull="false" />
<SupportUsername isNull="false" />
<Website isNull="false" />
<CreatDate>3/14/2021 3:07:50 PM</CreatDate>
<CrmId>63a62e6e-e180-4b87-ba41-95e06b99a837</CrmId>
<CrmObjectTypeCode isNull="false" />
<CrmObjectTypeId>5d77edcb-bf9e-419f-9955-e6881c272711</CrmObjectTypeId>
<CrmObjectTypeIndex>0</CrmObjectTypeIndex>
<CrmObjectTypeName isNull="false" />
<ExtendedProperties attr0="BaseCrmObjectExtendedPropertyInfoArray" isNull="false">
<BaseCrmObjectExtendedPropertyInfoArray0>
<Name isNull="false" />
<UserKey isNull="false" />
<Value isNull="false" />
</BaseCrmObjectExtendedPropertyInfoArray0>
</ExtendedProperties>
<ModifyDate>3/14/2021 3:07:50 PM</ModifyDate>
<ParentCrmObjectId>c73d3aff-21b2-4ef2-b2ef-c5198c18613f</ParentCrmObjectId>
<ProcessStateIndex>0</ProcessStateIndex>
<RefId isNull="false" />
<Stage isNull="false" />
<StageId>66064558-e7a5-4365-a739-5f138bb548e7</StageId>
<Tags attr0="StringArray" isNull="false">
<StringArray0 isNull="false" />
</Tags>
</identity>
</MethodParameters>
</SaveIdentity>
و این پیغام رو با این نرم افزار که گفتیتد می دهد
<SaveIdentity>
<MethodParameters>
<SaveCrmObjectResult>
<CrmId>00000000-0000-0000-0000-000000000000</CrmId>
<Message>Object reference not set to an instance of an object.</Message>
<Success>False</Success>
</SaveCrmObjectResult>
</MethodParameters>
</SaveIdentity>
همچنین اصلا فیلد LastName و FirstName ندارد
مقادیر رو اشتبه پاس دادید
<SaveIdentity>
<MethodParameters>
<username isNull="false" />
<password isNull="false" />
<identity actualtype="PersonInfo" basetype="IdentityInfo">
<AreasOfInterest isNull="true" />
<BirthDate isNull="true" />
<Children isNull="true" />
<CreditType isNull="true" />
<Degree isNull="true" />
<Employees isNull="true" />
<FacebookUsername isNull="true" />
<FirstName isNull="true" />
<Gender isNull="true" />
<Hobbies isNull="true" />
<LastName>tname</LastName>
<MannerType isNull="true" />
<NationalCode isNull="true" />
<PaymentStatusType isNull="true" />
<PersonPrefix isNull="true" />
<PrefferedContactType isNull="true" />
<Spouse isNull="true" />
<AddressContacts isNull="true" />
<Balance isNull="true" />
<Categories attr0="CategoryInfoArray" isNull="false">
<CategoryInfoArray0>
<Id isNull="true" />
<IdentityId isNull="true" />
<IsDeleted>False</IsDeleted>
<Key>cqat</Key>
<Name isNull="true" />
<Type isNull="true" />
</CategoryInfoArray0>
</Categories>
<Classification isNull="true" />
<ColorName isNull="true" />
<CustomerDate isNull="true" />
<CustomerNumber isNull="true" />
<DontEmail isNull="true" />
<DontFax isNull="true" />
<DontPhoneCall isNull="true" />
<DontSms isNull="true" />
<DontSocialSms isNull="true" />
<Emails isNull="true" />
<IdentityType>حقیقی</IdentityType>
<NickName>ققق</NickName>
<OtherUsername isNull="true" />
<PhoneContacts isNull="true" />
<SaleUsername isNull="true" />
<SourceType isNull="true" />
<SupportUsername isNull="true" />
<Website isNull="true" />
<CreatDate>1/1/0001 12:00:00 AM</CreatDate>
<CrmId isNull="true" />
<CrmObjectTypeCode>testtypekey</CrmObjectTypeCode>
<CrmObjectTypeId isNull="true" />
<CrmObjectTypeIndex>0</CrmObjectTypeIndex>
<CrmObjectTypeName isNull="true" />
<ExtendedProperties isNull="true" />
<ModifyDate>1/1/0001 12:00:00 AM</ModifyDate>
<ParentCrmObjectId isNull="true" />
<ProcessStateIndex isNull="true" />
<RefId isNull="true" />
<Stage isNull="true" />
<StageId isNull="true" />
<Tags isNull="true" />
</identity>
</MethodParameters>
</SaveIdentity>

داده های خودتون رو با این replace کنید
مواردی که نمیخواهید پاس بدهید رو باید null کنید مثلا شما Crmid رو null نکرده بودید برا ی مثال
درباره ارسال یک فایل به وب سرویس فرم به چه نحوی باید عمل کرد اصلا این امکان وجود دارد یا نه لطفا راهنمایی کنید