I have a registration form with a DateTimeDropdown claim type to allow a user to select their date of birth.
This is the policy configuration of the claim:
<ClaimType Id="dateOfBirth">
<DisplayName>Date of birth</DisplayName>
<DataType>date</DataType>
<UserHelpText>Please select your birth date</UserHelpText>
<UserInputType>DateTimeDropdown</UserInputType>
</ClaimType>
And how it renders on the form:
The Year selection gives a range starting at 1900 and goes up to 2050.
Is there any custom policy configuration to alter, limit, or reorder the values present in this dropdown?
This is now possible by using the PredicateValidations. See date range
With the Predicates and PredicateValidations elements you can control the minimum and maximum date values of the UserInputType by using a DateTimeDropdown
<Predicates>
<Predicate Id="DateRange" Method="IsDateRange" HelpText="The date must be between 01-01-1980 and today.">
<Parameters>
<Parameter Id="Minimum">1980-01-01</Parameter>
<Parameter Id="Maximum">Today</Parameter>
</Parameters>
</Predicate>
</Predicates>
Add a PredicateValidation with a reference to the DateRange predicate.
<PredicateValidations>
<PredicateValidation Id="CustomDateRange">
<PredicateGroups>
<PredicateGroup Id="DateRangeGroup">
<PredicateReferences>
<PredicateReference Id="DateRange" />
</PredicateReferences>
</PredicateGroup>
</PredicateGroups>
</PredicateValidation>
</PredicateValidations>
In your claim type, add PredicateValidationReference element and specify the identifier as CustomDateRange.
<ClaimType Id="dateOfBirth">
<DisplayName>Date of Birth</DisplayName>
<DataType>date</DataType>
<AdminHelpText>The user's date of birth.</AdminHelpText>
<UserHelpText>Your date of birth.</UserHelpText>
<UserInputType>DateTimeDropdown</UserInputType>
<PredicateValidationReference Id="CustomDateRange" />
</ClaimType>
Related
We have event notifications set up to send us a notification request for user actions.
I am trying to validate the document status to figure out if an user has signed a document. When the user has signed the document using docusign, I can capture the status from TabStatuses in the request.
However, I am not unable to figure out a way to handle the scenario where an user has opted to print and sign as the response for Print and Sign notifications does not include the TabStatuses with the status.
I have tried to go through the documentation to figure out if there is a way to confirm that the user has opted to print and sign the document, but I couldn't find what I was looking for. I do get DocumentStatus which returns a name node signed_on_paper_<reference_id> but it doesn't seem like the best approach to validate that the user has opted to print and sign.
Also in the case of multiple signers, what would be the best way to identify the status of each signer.
Sample response I received when a user opted to print and sign:
<EnvelopeStatus>
<RecipientStatuses>
<RecipientStatus>
<Type>
Signer
</Type>
<Email>
sdasari#plxs.com.au
</Email>
<UserName>
Shyam Dasari
</UserName>
<RoutingOrder>
1
</RoutingOrder>
<Sent>
2019-10-15T16:23:38.06
</Sent>
<Delivered>
2019-10-15T16:23:50.15
</Delivered>
<Signed>
2019-10-15T16:24:35.167
</Signed>
<DeclineReason xsi:nil="true" />
<Status>
Completed
</Status>
<RecipientIPAddress>
115.70.163.1
</RecipientIPAddress>
<ClientUserId>
7422
</ClientUserId>
<CustomFields />
<AccountStatus>
Active
</AccountStatus>
<EsignAgreementInformation>
<AccountEsignId>
e17f1e7a-2d2f-49e7-bdc6-gibberish
</AccountEsignId>
<UserEsignId>
75eda468-405c-48a3-bf8c-gibberish
</UserEsignId>
<AgreementDate>
2019-10-15T16:23:50.15
</AgreementDate>
</EsignAgreementInformation>
<RecipientId>
e1e8e99a-b89f-4d5c-aa27-gibberish
</RecipientId>
</RecipientStatus>
</RecipientStatuses>
<TimeGenerated>
2019-10-15T16:24:55.6107604
</TimeGenerated>
<EnvelopeID>
530aa34b-1991-4bc6-b374-gibberish
</EnvelopeID>
<Subject>
Shyam Dasari has sent you a document to review and sign
</Subject>
<UserName>
Legal Gateway Sandbox
</UserName>
<Email>
callum#testsoftware.com.au
</Email>
<Status>
Completed
</Status>
<Created>
2019-10-15T16:23:37.67
</Created>
<Sent>
2019-10-15T16:23:38.093
</Sent>
<Delivered>
2019-10-15T16:23:50.307
</Delivered>
<Signed>
2019-10-15T16:24:35.167
</Signed>
<Completed>
2019-10-15T16:24:35.167
</Completed>
<ACStatus>
Original
</ACStatus>
<ACStatusDate>
2019-10-15T16:23:37.67
</ACStatusDate>
<ACHolder>
Legal Gateway Sandbox
</ACHolder>
<ACHolderEmail>
callum#test.com.au
</ACHolderEmail>
<ACHolderLocation>
DocuSign
</ACHolderLocation>
<SigningLocation>
Online
</SigningLocation>
<SenderIPAddress>
115.70.163.1
</SenderIPAddress>
<EnvelopePDFHash />
<CustomFields>
<CustomField>
<Name>
AccountId
</Name>
<Show>
false
</Show>
<Required>
false
</Required>
<Value>
12345
</Value>
<CustomFieldType>
Text
</CustomFieldType>
</CustomField>
<CustomField>
<Name>
AccountName
</Name>
<Show>
false
</Show>
<Required>
false
</Required>
<Value>
Legal Gateway
</Value>
<CustomFieldType>
Text
</CustomFieldType>
</CustomField>
<CustomField>
<Name>
AccountSite
</Name>
<Show>
false
</Show>
<Required>
false
</Required>
<Value>
demo
</Value>
<CustomFieldType>
Text
</CustomFieldType>
</CustomField>
</CustomFields>
<AutoNavigation>
true
</AutoNavigation>
<EnvelopeIdStamping>
true
</EnvelopeIdStamping>
<AuthoritativeCopy>
false
</AuthoritativeCopy>
<DocumentStatuses>
<DocumentStatus>
<ID>
4321
</ID>
<Name>
sid_0a_2s_rando_doc_2_1405
</Name>
<TemplateName />
<Sequence>
1
</Sequence>
<DocumentFields>
<DocumentField>
<Name>
reference_id
</Name>
<Value>
gibberish:1iKFJ0:gibberish-Cw
</Value>
</DocumentField>
</DocumentFields>
</DocumentStatus>
<DocumentStatus>
<ID>
2
</ID>
<Name>
Signed-on-Paper_more-gibberish-aa27-bafd4d393c02
</Name>
<TemplateName />
<Sequence>
2
</Sequence>
</DocumentStatus>
</DocumentStatuses>
</EnvelopeStatus>
If a user opted to sign using docusign's esignature, I get TabStatuses in the response which help me identify the current state of the document.
<TabStatuses>
<TabStatus>
<TabType>
SignHere
</TabType>
<Status>
Signed
</Status>
<XPosition>
699
</XPosition>
<YPosition>
754
</YPosition>
<TabLabel>
Signature 1_SignHere_gibberish_id
</TabLabel>
<TabName />
<DocumentID>
2460
</DocumentID>
<PageNumber>
1
</PageNumber>
</TabStatus>
</TabStatuses>
I am using the docusign api version 2.
When a user signs on paper there are no tabs.
Moreover, there's no way for you to know what paper was actually signed.
When the envelope is complete, you'll find an additional document in it, which is the paper that was faxed into the system. That is the only information you get back from a user that signs on paper.
(We strongly discourage use of paper, and if one uses it - there are certain limitations to what we can support).
i would need a help on how to parse xml files with nested tags taking the user input as attribute value of a particular tag.
for eg:
if xml code has 12 mappings and we want to select the below mapping name "m_IF1_TD_SALESORDER_STG_PR4_VBPA_BUSINESS_PARTNER" as user input and thereby printing the particular mapping details.
<MAPPING NAME="m_IF1_TD_SALESORDER_STG_PR4_VBPA_BUSINESS_PARTNER" DESCRIPTION="Data Mapping for loading Sales Order Business Partners from the staging database for PR4." OBJECTVERSION="1" ISVALID="YES" VERSIONNUMBER="1">
<TRANSFORMATION NAME="sq_STG_PR4_VBPA" DESCRIPTION="" TYPE="Source Qualifier" OBJECTVERSION="1" REUSABLE="NO" VERSIONNUMBER="1">
<TRANSFORMFIELD NAME="MANDT" DESCRIPTION="" DATATYPE="string" PORTTYPE="INPUT/OUTPUT" PRECISION="3" SCALE="0" PICTURETEXT="" DEFAULTVALUE="" EXPRESSION="MANDT" EXPRESSIONTYPE="GENERAL"/>
<TRANSFORMFIELD NAME="VBELN" DESCRIPTION="" DATATYPE="string" PORTTYPE="INPUT/OUTPUT" PRECISION="10" SCALE="0" PICTURETEXT="" DEFAULTVALUE="" EXPRESSION="VBELN" EXPRESSIONTYPE="GENERAL"/>
<TRANSFORMFIELD NAME="POSNR" DESCRIPTION="" DATATYPE="decimal" PORTTYPE="INPUT/OUTPUT" PRECISION="6" SCALE="0" PICTURETEXT="" DEFAULTVALUE="" EXPRESSION="POSNR" EXPRESSIONTYPE="GENERAL"/>
<TRANSFORMFIELD NAME="PARVW" DESCRIPTION="" DATATYPE="string" PORTTYPE="INPUT/OUTPUT" PRECISION="2" SCALE="0" PICTURETEXT="" DEFAULTVALUE="" EXPRESSION="PARVW" EXPRESSIONTYPE="GENERAL"/>
I would suggest using the XML ElementTree module of python.
It is very simple to use. For example:
import xml.etree.ElementTree as ET
tree = ET.parse('/filename.xml')
root = tree.getroot()
for subchild in root.findall('subchildName'):
print(subchild.get('subchildAttribute')
I am trying to create a report in fetchxml on crm 2011 that displays a list of Account Names, and also in the same row displays the date of ONLY the most recent activity for that account.
So
Report should look like
Account1, Date of most recent activity for Account 1
Account2, Date of most recent activity for Account 2
Account3, Date of most recent activity for Account 3
I have a fetch query that pulls the correct data, but it pulls a row for each activity for the account instead of just for the newest activity.
so it looks like
Account1, Date of most recent activity for Account 1
Account1, Date of other activity for Account 1
Account2, Date of most recent activity for Account 2
Account2, Date of other activity for Account 2
Account3, Date of most recent activity for Account 3
Here is my fetch
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" aggregate="false">
<entity name="<accountentityname>"
<attribute name="<accountname>" />
<link-entity name="activity" from="<regardingaccoutnfield>" to="<account field>" visible="false" link-type="outer">
<attribute name="<date of activity>" />
</link-entity>
</entity>
</fetch>
Any suggestions?
Thanks.
Not sure if the maxaggregate attribute will work with datetimes, but if it does that might work
What you're wanting to do requires a subquery. This is something that CRM does not support.
If you're not using CRM Online, just perform a standard SSRS query using SQL rather then FetchXml.
If you're just trying to pull back data with the SDK, you could perform the subquery on the client side.
Why Max Aggregate Won't Work
If your column you were wanting to get the max value on was a number you could use an aggregate, but Aggregate functions AVG, MIN, MAX, or SUM can only be applied to attributes of type integer, float, money, bigint, or decimal.
That's the error if you attempt to run this query:
var xml = #"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true' aggregate='true'>
<entity name='contact'>
<attribute name='fullname' alias='name' groupby='true' />
<attribute name='contactid' alias='id' groupby='true' />
<link-entity name='activitypointer' from='regardingobjectid' to='contactid' alias='ad' link-type='outer'>
<attribute name='createdon' alias='createdon_max' aggregate='max' />
<filter type='and'>
<condition attribute='createdon' operator='not-null' />
</filter>
</link-entity>
</entity>
</fetch>";
EntityCollection fetchResult = service.RetrieveMultiple(new FetchExpression(xml);
You can do a sort on the date and return the first record only!
Do your query on accounts then return a for each & use something like:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="activitypointer">
<attribute name="scheduledstart" />
<order attribute="scheduledstart" descending="true" />
<filter type="and">
<condition attribute="scheduledstart" operator="not-null" />
</filter>
</entity>
</fetch>
OR similar Query Expression:
QueryExpression query = new QueryExpression("activitypointer");
query.ColumnSet.AddColumns("scheduledstart");
query.AddOrder("scheduledstart", OrderType.Descending);
EntityCollection results = service.RetrieveMultiple(query);
Then something like:
(DateTime)(((Entity)results.Entities.First()).Attributes["scheduledstart"]);
Add the condition that the regarding field is equal to the account.id that's in scope for the for each loop
I'm a newbe in ActivePivot and i want to create a dimension with DimensionType = time, where the dates a shown in hierachical manner. E.g. for 30.01.2013 i need one level for the year -> 2013 (sort descending), one level for the month (also sort descending) -> 1 and one level for the days (also sort descending) -> 30, 29, 28, ...
Viewed via ActivePivotLive should look like:
- 2013
- 1
- 30
- 29
- 28
- ...
+ 2012
+ 2011
and so on.
I went through the ActivePivot sandbox project, but i didn't find anything that helps me. The TimeBucket dimension which i've found in the EquityDerivativesCube makes something similar but the buckets are created in a different manner.
How can i solve this problem?
Ok, i handle it out.
It is not necessary to make the round trip and to implement a dimension. It is easy done by levels and the a calculator.
Here the code from the EquityDerivativesCube.xml
<!-- Standard time buckets, bucketing performed at insertion -->
<dimension name="TimeBucket">
<properties>
<entry key="DimensionType" value="time" />
<entry key="IsAllMembersEnabled" value="true" />
</properties>
<level name="Year">
<properties>
<entry key="LevelType" value="TIME_YEARS" />
</properties>
<comparator pluginKey="ReverseOrder" />
</level>
<level name="Month">
<properties>
<entry key="LevelType" value="TIME_MONTHS" />
</properties>
<comparator pluginKey="Custom">
<order name="firstObjects">
<value>Jan</value>
<value>Feb</value>
<value>Mrz</value>
<value>Apr</value>
<value>Mai</value>
<value>Jun</value>
<value>Jul</value>
<value>Aug</value>
<value>Sep</value>
<value>Okt</value>
<value>Nov</value>
<value>Dez</value>
</order>
</comparator>
</level>
<!-- The Value Date level is the field Date -->
<level name="Value Date" property="Date">
<properties>
<entry key="LevelType" value="time" />
</properties>
<comparator pluginKey="ReverseOrder" />
</level>
</dimension>
I added the following snippet to PNLCalculator.enrichTrade:
...
pnl = pnlVega + pnlDelta;
// Year and month calculations BEGIN
final Calendar cal = CALENDAR.get();
cal.setTime(trade.getDate());
final int year = cal.get(Calendar.YEAR);
final String month = DateFormatSymbols.getInstance(GERMANY).getShortMonths()[cal.get(MONTH)];
// Year and month calculations END
// instantiate the result that will hold the enrichment data
final PNLCalculatorResult result = new PNLCalculatorResult();
...
// add them to the result
result.setYear(year);
result.setMonth(month);
...
I also extended the SanboxFields.xml with the two new fields:
...
<field name="Year" type="integer" />
<field name="Month" type="string" />
...
Cheers!
The TimeBucket dimension in the ActivePivot Sandbox application defines a custom bucketing based on financial time periods. Creating a standard year > month > day hierarchy is actually simpler and seamless in ActivePivot. In the description if the schema you need to declare three fields (one for year, one for month and one for the day).
<field name="Year" indexation="dictionary" />
<field name="Month" indexation="dictionary" />
<field name="Day" indexation="dictionary" />
And then you need to declare a dimension that references those fields.
<dimension name="Time">
<level name="Year" />
<level name="Month" />
<level name="Day" />
</dimension>
Then ActivePivot will build the time hierarchy incrementally, by introspecting the loaded records.
This will work automagically if the input records (objects) already contain a Year attribute, a Month attribute and a Day atribute (For instance if the input records are POJOs with getYear(), getMonth() and getDay() methods). If that is not the case and that for instance the input records only have a date attribute, you can either transform your records before puutting them into ActivePivot, or inject a calculator in ActivePivot (com.quartetfs.biz.pivot.classification.ICalculator) that will on the fly compute the three fields from the date. Look at the ActivePivot Sandbox application for an example of calculator.
Extracting those fields is usually done with standard Java code:
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
System.out.println("Date: " + date);
System.out.println("Year: " + calendar.get(Calendar.YEAR));
System.out.println("Month: " + calendar.get(Calendar.MONTH) + 1);
System.out.println("Day: " + calendar.get(Calendar.DAY_OF_MONTH));
About the ordering of members in the level of a dimension, ActivePivot per default uses the natural ordering of java objects (those that implement java.lang.Comparable interface) so dates and integers will be sorted from the lowest to the greatest. You can easily reverse that by declaring a "ReverseOrder" comparator on the target level(s).
<dimension name="Time">
<level name="Year">
<comparator pluginKey="ReverseOrder" />
</level>
<level name="Month">
<comparator pluginKey="ReverseOrder" />
</level>
<level name="Day">
<comparator pluginKey="ReverseOrder" />
</level>
</dimension>
i create a content type using feature as below
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID ="{4C939423-2090-413d-B241-724D9B66F74B}"
Name="VersionNumer"
DisplayName="Version Number"
Type="Text"
Required="TRUE"
Group="CT" >
<Default>0</Default>
</Field>
<Field ID ="{33E51B7A-FEE2-4995-B4BB-9F3F909C1015}"
Name="DocumentType"
DisplayName="Document Type"
Type="Choice"
Required="TRUE"
Group="CT">
<Default>Other</Default>
<CHOICES>
<CHOICE>Document</CHOICE>
<CHOICE>Excel</CHOICE>
<CHOICE>PowerPoint</CHOICE>
<CHOICE>Other</CHOICE>
</CHOICES>
</Field>
<ContentType ID="0x0101000728167cd9c94899925ba69c4af6743e"
Name="myCT"
Group="myCT"
Description="myCT"
Version="0">
<FieldRefs>
<FieldRef ID="{4C939423-2090-413d-B241-724D9B66F74B}" Name="VersionNumber" DisplayName="Version Number" Required="TRUE" />
<FieldRef ID="{33E51B7A-FEE2-4995-B4BB-9F3F909C1015}" Name="DocumentType" DisplayName="Document Type" Required="TRUE" />
</FieldRefs>
</ContentType>
</Elements>
How can i set default value for VersionNumer is 0 and default value for DocumentType is Other? I used default tag but it was not efficent.
And another question, how to force user to input VersionNumer and DocumentType. I used atrtibute required="true" but it was not successful.
Thanks in advance.
I've tried this in my environment, it works perfectly. I copy 'n' pasted the contents of elements.xml and didn't make a single modification.
Try this:
Delete your existing site columns and content type (in that order)
Deactivate your feature
IISRESET
Activate your feature again and check if the default values are ok, they should be
Add your choices field and after that put the default tag
enter code here
<CHOICES>
<CHOICE>Document</CHOICE>
<CHOICE>Excel</CHOICE>
<CHOICE>Other</CHOICE>
</CHOICES>
<Default>Other</Default>