Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all 46379 articles
Browse latest View live

AddCustomFilter Not Working as Expected (Neither In-line NOR Lookup)

$
0
0

I have found quite a few helpful resources about the AddCustomFilter method in jScript that can help us to filter a lookup in ways that OOB CRM cannot.  I have been tackling this issue for a while, and have gone at it in a number of different ways.

Here is the requirement:
On a Work Order Product, the Product Lookup must be filtered to show only Products that belong to the PriceList which is set on the Work Order.    Using related records (OOB) filtering, I can only achieve this by using the Default Price List of a product - which will not work for my requirement.

Basically, I want the Product Lookup to only return Products that exist in the Price List that is set on the Work Order.  

Right now, I am getting *some type* of filtered list, but it isn't correct.  And further, inside the lookup window (where you can change the views, do search, etc), if I click the Magnifying Glass (Search) icon twice, the 'filter' (which again is not correct) disappears, and then a list of ALL FS Products is shown.  Why is that?

Here is my code. This is the simplest implementation I've tried over a number of attempts.  I just recently added the Try/Catch blocks, since this was so dang simple, I wasn't thinking i'd need them. But at this point, I am not catching any errors, no errors in F12 Debug, and no errors popped by CRM UI.

Any thoughts on why this his happening?

function FilterWOProductList() {
    
        var PriceList = Xrm.Page.getAttribute("msdyn_pricelist").getValue();
        //checking if pricelist fields is empty before we apply the filter
        if (PriceList != null) {
            Xrm.Page.getControl("msdyn_product").addPreSearch(Filter);
        }
    }

    function Filter() {

        var PriceListValue = Xrm.Page.getAttribute("msdyn_pricelist").getValue();
        var PriceList = Xrm.Page.getAttribute("msdyn_pricelist").getValue();
        //if PriceList has a value, proceed
        if (PriceList != null) {
            //used to retrieve Name of the Price List held in the PriceList field
            var PriceListTextValue = PriceListValue[0].name;
            //GUID used in filter (pricelist GUID)
            var PriceListID = PriceListValue[0].id;

            try {
                var plist_filter = "<filter type='and'>" + "<condition attribute='msdyn_pricelist' operator='eq'  value='" + PriceListID + "' />" + "</filter>";
                Xrm.Page.getControl("msdyn_product").addCustomFilter(plist_filter, "msdyn_product");
            }

            catch (e) {
                Xrm.Utility.alertDialog("addFilter Error: " + (e.description || e.message));
            }
        }
    }



Copying just two entities data from Dev to Test, On premise 2015

$
0
0

Hi

We are using 2015 onpremise Dynamics CRM. Is there any easy way to copy just the two entities data from  Dev to Test environment with out using the SSIS or Scribe tools.

If so, any help or guidance  for doing the step by step is highly appreciated!

Thanks

ADXStudio and Exchange Server

$
0
0

Our client has CRM where ADXStudio has installed. Now, they are going to have new Exchange Server. We are going to configure CRM to connect to it. No problem with that.

Question is do we need to do anything for ADXStudio? I didn't work before with ADX and the guy who implemented it left the company.

Record Creation on Workflow A not triggering on-create-listening Workflow B in CRM 365 9.0.1.459

$
0
0

Hello Everyone,

So I have a workflow that is listening to the status reason change of entity A. When entity A's workflow runs it creates zero or many of a completely different entity -- entity B. I have second workflow listening for the creation of entity B records. Looking at System Jobs its not triggering. Why might it not be triggering the second workflow?

The second workflow is running in the background. Its trying to make a Task pointing to the record that was just created, but as mentioned in System Jobs, it doesn't even show that it ran.

Any help would be really appreciated. Thank you.

Connection Entity plug-in creates Duplicate records

$
0
0

Hi,

I created a plug-in on Connection entity for "Create" step. This custom plug-in will create Connection records based on below scenarios.


1. If the user select a specific role and lookup type as "Contact" then i have business logic that creates another connection record against the associated Account of the selected contact. Technically i am creating one more record based on the selection so each time when the user create a connection it creates 2 records.

Ex: Opportunity record -> Click on connection -> Select a Contact and Select a Role mapped to Contact.

This will create 2 records 1 with the actual selection and the other with business logic as defined. 1 against contact and one more against account.

2. Similar way the same plug-in will create a connection with contact if the user select the lookup type as "Account".

Ex: Opportunity record -> Click on Connection -> Select an Account and Select a Role mapped to Account.

This will create 2 records 1 with the actual selection and the other with business logic as defined. 1 against Account and one more against Contact.

Every thing works fine except below scenario.

There are some records in system where a Contact is listed as Primary Contact for an account and the same account is setup as parent account for that contact.
When i select these kind of records its creating continuous entires around 10 records and no control to stop.
we have Many to Many relationship setup for Contact to Account and Account to Contact. I guess because of this its creating these records, is there any way i can stop creating these records in my plug-in or any other best way to stop these duplicate connections?

I also tried to stop the related entity records that is mentioned in below link but this is also not working in the above scenario.

community.dynamics.com/.../problems-with-plugins-on-connection-entity-in-crm-2011

Hiding Ribbon Buttons for security roles using JavaScript

$
0
0

Hello

We are doing mass Hide/ unhide of ribbon buttons using JavaScript. Which in turn is effecting our Form load performance, Onload the we don't see any ribbon buttons and the form would be frozen, after a while we see the ribbon buttons then the form is functional. We got a reply to the Microsoft ticket saying, As we are calling javascript on each buttons visibility, The script is taking too long to check between users roles going back and fro. They recommended to declare variables for all security roles and compare later to reduce the retrieval time.

Below is the code that I'm using right now. 

function showhideoperation() {        
    debugger;
    var button = GetOperationUser();

    return button;
}

function GetOperationUser() {
    debugger;
    var isUserRole = true;

    var roles = Xrm.Page.context.getUserRoles();
    for (var i = 0; i < roles.length; i++) {
        var role = GetOperationRoles(roles[i].replace("{", "").replace("}", ""));
        if (role)
            return false;
    }


    return isUserRole;
}

function GetOperationRoles(userRoleId) {
    debugger;
    var isUserRole = false;

    var zipcodeFetchXML = ['<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">' +
        '<entity name="role">' +
        '<attribute name="name" />' +
        '<attribute name="businessunitid" />' +
        '<attribute name="roleid" />' +
        '<order attribute="name" descending="false" />' +
        '<filter type="and">' +
        '<condition attribute="roleid" operator="eq" value="' + userRoleId + '" />' +
        '</filter>' +
        '</entity>' +
        '</fetch>'].join('');

    var encodedFetchXML = encodeURIComponent(zipcodeFetchXML);
    var dcs_zipcodeid
    var req = new XMLHttpRequest();
    req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/roles?fetchXml=" + encodedFetchXML, false);
    req.setRequestHeader("OData-MaxVersion", "4.0");
    req.setRequestHeader("OData-Version", "4.0");
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("Prefer", "odata.include-annotations=OData.Community.Display.V1.FormattedValue");
    req.onreadystatechange = function() {
        if (this.readyState === 4) {
            req.onreadystatechange = null;
            if (this.status === 200) {

                var results = JSON.parse(this.response);
                for (var i = 0; i < results.value.length; i++) {
                    var roles = results.value[i];
                    //Single Line Text                

                    //UniqueIdentifier
                    if (roles['name'].toLowerCase() == "system administrator") {
                        return false;

                    }
                    if (roles['name'].toLowerCase() == "operation 2") {
                        isUserRole = true;
                    }
                }

            }
            else {
                alert(this.statusText);
            }
        }
    };
    req.send();


    return isUserRole;
}


I'm using the code on multiple buttons of different entities. 

I added Entity privilege rule for majority of buttons, but the remaining buttons the only way is to hide using security roles.

Query Builder Error - Field does not exist

$
0
0

Hello,

After the recent update to CRM online, I exported unmanaged solution with all the entities from sandbox to production.

I am getting the following error when clicking Parent Account field in Contacts:

Log file shows this:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: 'Account' entity doesn't contain attribute with Name = 'contactid' and NameMapping = 'Logical'. MetadataCacheDetails: ProviderType=Dynamic, StandardCache=True, IsLoadedInStagedContext = False, Timestamp=4785886, MinActiveRowVersion=4785886Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>bce47989-ab4e-456a-9327-64bcc3efb144</ActivityId>
<ErrorCode>-2147217149</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>'Account' entity doesn't contain attribute with Name = 'contactid' and NameMapping = 'Logical'. MetadataCacheDetails: ProviderType=Dynamic, StandardCache=True, IsLoadedInStagedContext = False, Timestamp=4785886, MinActiveRowVersion=4785886</Message>
<Timestamp>2018-03-01T01:04:26.0553452Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

Any help on this please?

Thank you.

Error on clicking Existing Contact and Existing Account

$
0
0

Hello,

We are using CRM online, latest update.

On clicking Existing Contact and Existing Account (on the ribbon in LEADS) it shows the following error:

Any help on this please?

Thank you.


Disable ALL errors from showing in mobile app?

$
0
0

We get such an insane amount of errors in our mobile app. If you use the app continuously for ten minutes, you will see probably 20 messages at a minimum depending on what you're doing. Each time you have to say "send" or "don't send" the error report to microsoft.

Can I just disable this completely??   The error's don't seem to impede at all in using the app, but they certainly are 100% annoying! :)

Can't see fields from Contact entity while modifying Mail Template for Send Invitation workflow

$
0
0

Hello,

Some times I don't see fields from Invite (Contact) entity, while trying for modify "Send Invitation" workflow Mail Template, see image below.

It is very strange behaviour, After closing and reopening template screen many times, finally it shows fields properly from Contact entity.

Does anyone faced it before?

Regards,

Ashish

Couldn't show target invite's (contact) fields in Portal invitation mail while sending Group Invitation

$
0
0

Hello,

I have configured Send Invitation workflow > Mail template to show Invite's (contact), like below picture.

When I am executing Send Invitation workflow, the actual mail sent like image below.

However, I have set FirstName, and LastName set for target Invite. I couldn't Identify the cause. There is another problem I facing, I created separate issue here - https://community.dynamics.com/crm/f/117/t/270961

I doubt it is related with each other.

Please let me know if someone has solution.

Thanks,

Ashish

Mobile app: can I not show more than one column in a view on a custom entity???

$
0
0

So I have a custom entity - it's an activity type. I have created a view and included it in a dashboard that is being shown in the mobile app. I am now trying to control which fields show in the list view on the dashboard for this entity.  It seems like it will only show the first column specified in the view.  But I notice another entity, it shows the first three column's in its list view. 

So I thought "maybe views in dashboards only allow one column to be shown on the list" - but when I just navigate to the entity itself on mobile, I still only get one column. All while another entity shows three columns.

How can I control this and get more columns to show?! It is critical but seems impossible to do??

test

Value of a field getting Auto Populated in CRM Online

$
0
0

Hello,

I have 3 fields in Opportunity named Partner 1, Partner 2 and Partner 3.

All are lookup fields to Accounts (Relationship=Partner)

When a new opportunity is created from Opportunity, the three fields remain blank but when a new opportunity is created from Accounts (through quick create Opportunity form) the three fields gets the value of Potential Customer (Account name) field.

Not sure about this behaviour.

Any help would be appreciated.

Thank you.

Update task in WBS as complete when project record field is set to "YES" using Workflows

$
0
0

Hi experts, 

I have a field in the project record called "deposit received" (two options - yes/no) .

Now, when I set this field as "Yes" I would like the task in the work breakdown structure to be marked as completed. 

Is this possible at all. If yes is it possible through workflows? 

Thanks,

Purvesh 


Integrate Dynamics with outlook mails

$
0
0

Dear Teams,

I would like to know the steps of procedures to integrate Dynamics Crm with Outlook mail

for the potential customer mails.

Thanks

Regards

Dev

How to restrict creating cases for unwanted emails using custom workflow in ms crm

$
0
0

Hi Guys,

How to restrict creating cases for unwanted emails using custom workflow in ms crm.

Thanks,

Vignesh M

Dynamics CRM Online: Quote to SalesOrder clone N:N relation

$
0
0

Case 

We have an entity called EANcode which has a N:N relation with Quote and SalesOrder. When a potential customer signs a Quote we will create a Sales Order based on its quote. Is it possible to add the related "EANcodes", which are connected to the quote, to the new Sales Order without programming?

I thought there was a solution in msdyncmrworkflootools with clone childs but I couldn't figure it out.

The duration of the second WO scheduling is 30 minutes

$
0
0

Hello,

I noticed a weird behavior when schedulling a WO two times. The first booking has the correct duration (+ travel time) but the second is 30 minutes. The travel time is not equal to this difference (see tasks and WO duration). The booking has been made through "Book" button.

Does anyone know why it is happening ?

Thanks

Displaying a Contact’s Facebook Picture in Microsoft Dynamics CRM

$
0
0



the Facebook profile picture has changed only for facebook pages and not for users and people

Is it because of a security constraint and what should I do to solve this problem?

thenks 

Viewing all 46379 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>