Can not create invitation code on CRM for contacts !
-
Wednesday, March 13, 2013 8:39 AM
Hello Everyone,
I installed customer portal and after deploy the web site i need to test it by invite someone to register So,
When i try to generate an invitation code, nothing happen and an error appear:
Microsoft Dynamics CRM Error Report Contents
<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>'CreateInvitationCode' is undefined</Message>Can you help me !
Thanks
All Replies
-
Thursday, March 14, 2013 10:06 PM
Fady,
On your Contact form should be a jscript called "msa_contact_main.."
Open that up and notice that the script is using CRM 4 syntax. (thanks so much for giving us a product with a built in time bomb microsoft!)
That needs to change to the CRM 2011 syntax.
Here's the change I had to make to mine (below). The two functions that create the UUID and the Expiration date dont need to be adjusted.
function Form_onload()
{
CreateInvitationCode=function()
{var username = Xrm.Page.data.entity.attributes.get('adx_username');
var invitation = Xrm.Page.data.entity.attributes.get('adx_invitationcode');
var expiry = Xrm.Page.data.entity.attributes.get('adx_invitationcodeexpirydate');
if (username == null || invitation == null || expiry == null)
{
alert('One of the required fields is missing from this form!');
return;
}var usernamevalue = username.getValue();
var invitationcode = invitation.getValue();
if (usernamevalue == null || usernamevalue == '')
{
if (invitationcode == null || invitationcode == '')
{
var newInviteCode = createUUID();
invitation.setValue(newInviteCode);var newDateExp = createExpiryDate();
expiry.setValue(newDateExp);
}
}
else
{
invitation.setValue("");
}}