Business rule: Add other field value to date? - dynamics-crm

I'm trying to programmatically set the Due Date field of a custom activity. I want take the value of another date-time field that the users enters and add the value from an integer field. But it seems that I can only select a static value to add using the business rules as shown here:
Is there a way to do it using business rules? Or do I have to use a Javascript instead?

You can use calculated field for these scenarios, but it is not a physical field to store. If you have to store the value, then Javascript or plugin or WF is better.
Business rules are limited in these situations.

This should be quite easy using PowerApps expression language; no need for PowerApps "Rules" (which are slated to be deprecated).
To your app:
Add a DatePicker control
Add a TextBox control
Add a Label control
Set the Label control's Text property to:
DateAdd(
DatePicker.Selected.Value,
Value(TextBox.Text),
Days
)
Bingo!

Related

How to autogenerate Primary Name field in custom Common Data Service Entity?

Primary Name field is by default "Required". How to fill this field by GUID or random number on save?
Codeless solution: You can mark that field as not a Business Required, so you will be unblocked. You can use a codeless UI workflow to populate the Primary Name field with some fixed text. This WF can be triggered on post-create.
Code solution: Plugin can be triggered on pre-create & custom C# code can be used to pre-populate some autonumber/text in this field.
Pro tip: Model driven app is nothing but classic Dynamics CRM, so while searching for solutions use that keyword :)
There is a GUID() function in PowerApps that generates a random GUID. By default, its result is a GUID type of data (text, value, date, etc.).
Primary Name is a text field. To coerce the result of the GUID function to be a text string, wrap Text() around it:
Text(GUID())
So in your Patch statement or in the Update property of the field for PrimaryName, you can use the expression above to put in a GUID as a string.

Why would I use a Kendo model instead of only using a transport/datasource

I am currently looking at Kendo UI and was wandering what is the "advantage" of defining a model in my schema. It seems to work quite well without. Is this for binding reasons (i.e. column discovery for Grid control for example) ? Does it allow particular validations ?
Thanks
Pat
You can use the schema model to specify your data model. On a grid, you can for example set:
Which data type the field has (if set to number, the column filter offers e.g. 'greater than, 'less than' instead of 'contains' etc. for string values).
If a grid field is editable or not (when grid is set to editable)
Several validation properties
...
I usually receive the grid data from a web service in JSON, so everything is a string initially. By using the model I influence how these values are displayed and how they behave.
See also
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.model
and http://docs.telerik.com/kendo-ui/api/javascript/data/model
for a full overview of possibilities.

Joomla Component Dynamic Custom Field based on other Field Value

I am creating a new Joomla Component. I am able to create custom fields for the component backend forms - but I am not able to create Dynamic Custom Fields.
What I would like to do is have a field that is dynamical populated based on the value of a previous field. The easiest way to explain this is the simple country,state,city breakdown.
Field 1 = Country
Field 2 = State (Based on what the user selected as as Country in Field 1)
Field 3 = City (Based on what the user selected as State in Field 2)
The fields would of course need to be refreshed, reset as the user picks a different country etc.
The data to populate the fields would also all need to come from a database based on the previous fields value.
I am guessing this needs to be done via ajax or javascript or something? But wondering if there is an official way? Especially since there are database calls involved.
Please let me know if there is anything I can explain better..
David
I ended up just creating text fields but then validating the input to make sure the values added are correct.

Removing fields from flyout in CRM 2015 OOB entity

I am customizing the contact entity (OOB) in CRM 2015. One of the attributes of this entity is Address, which is a composite attribute built using the following
Street1
City
State/Province
I like to remove the City field from the flyout alltogether.
How can I achieve this ?
Even though, currently there is no supported way to do control this (hopefully Microsoft might make this available in future release) But a little tweak did the trick for me to overcome this challenge.
I created a Business Rule ho hide the default fields (City, State and Country) from the form. I specifically wrote the Business Rule without specifying any conditions which means it will load/work all the time.
Consequently, with the effect of Business Rule the fields got hidden from the flyout menu as well. I changed the Display name of Address Composite Field to Street and made it Visible, also included the rest 3 new Lookup under same section.
Finally my requirement got fulfilled now as I was able to use the composite field to capture the 4-fields (Street1, Street2, Street3 and Zip Code) and also use the individual lookups for the City, State and Country.
Link: https://ashwaniashwin.wordpress.com/2014/03/24/update-change-address-composite-field-in-crm-2013-with-busoness-rules/

Can we prepopulate the webform fields with values in webforms for marketers?

We have a requirement to pre-populate the Contact Form with user information on load if the user is a logged in user. So that, user need not fill his information using the webform.
Is there any way to do this using webforms for marketers?
Data is coming from a service api in json format. Need to figure out a way to bind it to fields either in server side or in client side.
Sitecore Version 7.1 140117 WFFM Version "Web Forms for Marketers
2.4.0 rev. 140117"
Have a look at Sitecore - Webforms For Marketers Form - Use ReadQueryString Option. Basically, there is a checkbox, ReadQueryString, in presentation details that gives you the option to fill in the default values from the query string. If checked, you use the item names of the fields (not the display name or title) as keys and the values you want to set the fields to as the values in key-value pair in the querystring.
Create a new rule based on use default value from user profile [fieldname] field and amend it to pick up the value from your service API.
This will be your best way and simplest option in my opinion.
I use this same approach prepopulating ucommerce data from its API.
Create custom field and then you can pre-populate values as per your need.
Like if you want to populate any value in Single line text field the create custom field for this and then reflect forms dll and copy code then update code as per your need.
Please check https://sitecoretweaks.wordpress.com/2015/02/20/custom-field-type-for-sitecore-web-form-for-marketers/ blog post for more details.

Resources