Hi, have you found a suitable solution?
↧
Forum Post: RE: CRM 2013 Dashboard Add horizontal line for Goal Target.
↧
Blog Post: How to Set the Default Value for a Dynamics 365 OptionSet Control in a Canvas PowerApp
In this article, I demonstrate how easy it is to set the default value for a ComboBox control associated with a Dynamics 365 Option Set field in a Canvas PowerApp. The approach demonstrated eliminates the need to change the bound ComboBox control to an unbound DropDown control. Because of this, it also eliminates the need to use the Patch function for saving the record. The demonstration application is a sample ‘Leave Requests’ Canvas PowerApp. The app uses the Common Data Service (CDS) connector to access a Leave Requests entity in Microsoft Dynamics 365. The following image shows the app’s Edit Form open for adding a new Leave Request. There are no default values configured for any of the Option Set field controls on the form; i.e. Leave Type, Cover Person Response, Manager Response and Status Reason. These ComboBox controls are bound to the corresponding single-select Option Set fields from the Microsoft Dynamics 365 ‘Leave Requests’ entity. The automatically generated formulas for the Default property of each of these Option Set field’s corresponding Data Cards are as follows: For an existing Leave Request, “ThisItem.' Manager Response'”, returns the currently selected Manager Response option such as ‘Approved’ or ‘Declined’. However, for a new Leave Request, “ThisItem.' Manager Response'” does not return a value. The is also the case for the corresponding ‘Leave Type’, ‘Cover Person Response’ and ‘Status Reason’. The desired default value for Manager Response is ‘Pending’. Attempting to change the Default property formula, as shown in the following image, causes an “Expected OptionSetValue” error to be displayed. This error occurs an Option Set value is required, but “Pending” is a Text value. The approach is to use the corresponding Option Set enumeration provided by the underlying CDS ‘Leave Requests’ data source. In this example, the Display Name of the Dynamics 365 Option Set used for Manager Response is “Leave Manager Response”. Typing “‘Leave Manager Response’.” causes a list of matching enumerated options to be displayed below the formula. You may then select an option from the list or type the option Label such as “Pending”; i.e. “‘Leave Manager Response’.Pending”. The following image shows the updated formulas for the Default property of the other Option Set field related Data Cards on the Edit Form. The formula for Leave Type is unchanged because the User selects the Leave Type for themselves. The formula for Cover Person Response also considers whether a Cover Person is selected. As a result, when adding a new Leave Request, the default values for Cover Person Response, Manager Response and Status Reason are now set to the required default Option Set values. Completing the other fields clicking Accept, results in the successful creation of the new Leave Request. In conclusion, as shown in this example, it is easy to set the default value for an Option Set field in a Canvas App. The approach does not require the replacement of a bound ComboBox control with an unbound DropDown control and therefore does not require the use of the Patch function when saving the record.
↧
↧
Forum Post: RE: Steps to migrate from Dynamics 2016 8.1 to Dynamics 365 online
HI Johnny, How we will be migrating managed solutions. Thanks,
↧
Forum Post: RE: Handle null entityreference in LINQ
I have seen this error before. u can try below change and update me if it worked or not var info = (from cr in xrm.CreateQuery () join c in xrm.CreateQuery () on cr.GetAttributeValue ("course_contact").Id equals c.GetAttributeValue ("contactid").Id where c.GetAttributeValue ("contactid").Id == courseGuid select cr.title).FirstOrDefault(); Also please check if course_contact is right name of the field ?
↧
Forum Post: Making only BPF field required using JS
We have a field that is on the form and on the BPF. I would like to make the field conditionally required in the BPF to move from Stage X to Stage Y. However, when I use JS to make it required referencing the "header_process" field, the normal field on the form becomes required as well. Meaning that in order to save the record, you have to fill in a value, which I don't want. It should only be necessary to fill it in to go to the next stage. Is this just a limitation of CRM?
↧
↧
Forum Post: Making only the BPF field required using JS
We have a field that is on the form and on the BPF. I would like to make the field conditionally required in the BPF to move from Stage X to Stage Y. However, when I use JS to make it required referencing the "header_process" field, the normal field on the form becomes required as well. Meaning that in order to save the record, you have to fill in a value, which I don't want. It should only be necessary to fill it in to go to the next stage. Is this just a limitation of CRM?
↧
Blog Post: How to Detect Dataset PCF control is set for Home grid or Sub grid
Introduction In this blog, we will see how to identify whether the current Dataset PCF control is used for home grid or sub grid of Dynamics 365 CRM. Problem: Create one Dataset PCF control and set that control on Account entity home grid. In this control read the current entity home grid records using view details as show in the below code: If( context.parameters.sampleDataSet.getViewId() ) { //read the records as per the view details and process on it let viewId = context.parameters.sampleDataSet.getViewId(); } else { //read the all home grid records guid and read it one by one let recordsCollection = context.parameters.sampleDataSet.sortedRecordIds; } In the above code, first check if view details are present in context ( context.parameters.sampleDataSet.getViewId() ) ) or not. If there is view id within context then retrieve all records from that view using view id. If there is no view details in context then retrieve all records from CRM using guid. So if we add this control on Account entity Home grid it will work fine. On load of home grid we will get current view details and as per the view details (view id) the records are read from CRM. However, this logic fails on Account entity sub grid. Here, we have one custom entity ‘Publisher’ and there is one Account entity sub grid. If we set the Dataset PCF control to that sub grid, on load of sub grid we will get the current view details and because of that all records belonging to that view will get read from CRM. However, as only two records are associated for current publisher entity record, only that two records should be read from CRM. For this, we need to find some method to find out if current dataset PCF control is set for entity home grid or sub grid. On the load of sub grid it can be easily detected whether the current dataset PCF control is set for sub grid or not. If it is set for sub grid then we will get records guid collection using context.parameters.sampleDataSet.sortedRecordIds and read only the records associated with current record. Solution: On load of PCF control we get Context object, this object will refer CRM context. In this object you will get one property – contextString which defines location i.e. whether the current dataset PCF control is set for home grid or sub grid. Please find below code to read the contextString. context.navigation._customControlProperties.contextString So, on load of dataset PCF control we can also check whether the current control is set for sub grid or not with the help of below code: If( context.parameters.sampleDataSet.getViewId() && context.navigation._customControlProperties.contextString!=”subgrid” ) { //read the records as per the view details and process on it let viewId = context.parameters.sampleDataSet.getViewId(); } else { //read the all home grid records guid and read it one by one let recordsCollection = context.parameters.sampleDataSet.sortedRecordIds; } Now, as per the above code on load of dataset PCF control, if current control is set for the sub grid then it will not read the records from view, the records will be read from CRM on the basis of guid one by one. Conclusion In this way, you can detect whether Dataset PCF control is set for Home grid or sub grid.
↧
Forum Post: RE: javascripts for using in ms crm 365
Hi, Why don't you just create a function for the Save event. Check if the date field has a value and if greater than or equal to current date. If the date value does match the requirements you can cancel the Save event. Please look at the following links below on date comparison and cancelling form Save event: community.dynamics.com/.../compare-two-date-field-values-in-dynamics-crm-using-javascript community.dynamics.com/.../prevent-form-from-saving-on-clicking-the-save-button-using-javascript Hope this helps.
↧
Forum Post: RE: Integrating CRM 2013 on Premise and Office 365
See the following Technet article and see if it answers your question. In general Office 365 gets updated often, and this would be dependent on the release you are using. docs.microsoft.com/.../hh699818(v=crm.8) Office 365 (2016 version), is able to work with CRM 2013. You would have to check for newer versions of Office (2019 version) if that is what you are planning to install. I have not tried the 2019 version with CRM 2013. Good luck.
↧
↧
Forum Post: RE: javascripts for using in ms crm 365
Use below code and mark checked "Pass execution context as first parameter" when add function function DateValidation(context) { debugger; var actualStart ="actualstart"; var today = new Date(); today.setHours(0,0,0,0); var fromDate = Xrm.Page.getAttribute(actualStart).getValue(); if(fromDate != null && fromDate < today) { Xrm.Page.getAttribute(actualStart).setValue(null); return false; } else { return true; } } function OnSave(context) { debugger; var saveEvent = context.getEventArgs(); if (!DateValidation(context)) { alert("Start Time cannot less than Today's date"); saveEvent.preventDefault(); } }
↧
Forum Post: RE: Classic interface vs. Unified interface for yet to be go LIVE client
Hi, Although MS has deprecated the old Xrm.Page, and the recommendation has been to move to UCI, Microsoft has not yet officially deprecated the classic interface, which will give you 6 to 12 months until you will have to do this officially, but I believe that will be coming sometime soon. If you have the time, I would recommend moving to UCI. It will not take as long, and it is something that you will have to do anyway soon. Good luck.
↧
Forum Post: RE: Making only BPF field required using JS
Hi, You can set your field as required in the BPF itself like the below screenshot. by marking it as required in the Business Process itself. Please mark it as verified it found useful and let me know for any further queries. Regards, AxTechie2120
↧
Forum Post: RE: Making only BPF field required using JS
@AXTechie2120, I have made some words bold in my original post to make it more clear. I need it to be conditionally required. This means your option won't work as it will always be required.
↧
↧
Forum Post: RE: Deletion Service is not cleaning the PrincipalObjectAccess table
Update - this approach does work. I was doing something wrong. In the POA table, it maps to another entity record through the ObjectId field. You need to pull this related record, and then get the Parent record of it. If you update the owner of the parent it will update the record in the POA to Access From: The parent record could be different types, particularly if the record is an ActivityPointer, but for a lot of record types the parent is the Account. InheritedAccessRightsMask = 135069719 and AccessRightsMask = 0 To InheritedAccessRightsMask = 0 and AccessRightsMask = 0 and then the Deletion service will pick it up.
↧
Forum Post: RE: Making only BPF field required using JS
Hi, after making the field as required try the below code for not moving to next bpf if the required field is empty. function passonstage () { stage = Xrm . Page . data . process . getSelectedStage (); if ( requiredfield == null ) { var curProcessID = Xrm . Page . data . process . getActiveProcess (). getId (); Xrm . Page . data . process . setActiveProcess ( "curProcessID" , callBackFunction ) //remain in the same stage } else if ( requiredfield != null ) { //move on to the next stage } } function callBackFunction ( result ) { if ( result == "success" ) {} else {} } Please try the above and let me know. mark it as verified if found useful. Regards, AxTechie2120
↧
Forum Post: RE: Making only BPF field required using JS
Conditionally required means on what basis you want your field in the BPF to be conditionally required? Can you explain a bit?
↧
Forum Post: RE: Making only BPF field required using JS
Say the field that needs to be conditionally required in the BPF is Field A. The field is also on the form itself. We have another field on the form; Field B. If Field B is filled in, Field A is required to go from Stage X to Stage Y, but not required to save the record itself. If Field B is not filled in, Field A is not required. The problem is, people can toggle fill in or clear B whenever they want, so the requirement of A should be able to change without doing a refresh.
↧
↧
Forum Post: How do you import multiple lookup values to one field?
I'm hoping this is a pretty easy question - I need to import multiple lookup values into one field. How do I do this? For example, in my Account entity, I have a field called "Region" which is a lookup for the Territory entity. It's an N:N subgrid meaning it can contain more than one Territory in the field. I have a spreadsheet which contains all this information but I'm not sure how to actually import it. Using commas (,) and quotation marks (") to separate the values didn't work. Am I missing something obvious? Thanks in advance for any help with this!
↧
Forum Post: RE: Making only BPF field required using JS
try this , upto my understanding if (fieldB != null) { Xrm.Page.getAttribute("header_process_fieldA").setRequiredLevel("required"); } else if (fieldB == null) { Xrm.Page.getAttribute("fieldA").setRequiredLevel("none"); } Please explain these "If Field B is filled in, Field A is required to go from Stage X to Stage Y, but not required to save the record itself."
↧
Forum Post: RE: Making only BPF field required using JS
You mean you have fieldA in both stages X and Y? and how you want the values to be filled up.
↧