web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Select all phonecalls where "From" is null

(0) ShareShare
ReportReport
Posted on by

Hello!

I need to select all phonecalls where field "From" not contains any values (after selected I want to update this record).

How I could make that from C# (I have created workflow activity)?

I try to use QueryByAttribute and QueryExpression but I didn't make it (I got an error..)

Could anybody help me?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Select all phonecalls where "From" is null

    Try below

    1374.Untitled.jpg

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at
    RE: Select all phonecalls where "From" is null

    Hi Anatoliy,

    Why should you use C# code for the same? Using advanced find, we can filter out the phone call records and could bulk edit these records accordingly.

    5756.1.PNG

  • Anatoliy Veshemirsky Profile Picture
    on at
    RE: Select all phonecalls where "From" is null

    I need to do this from C# (in my workflow activity)

  • Anatoliy Veshemirsky Profile Picture
    on at
    RE: Select all phonecalls where "From" is null

    I try to do it:

               QueryByAttribute phonecall = new QueryByAttribute("phonecall");

               phonecall.ColumnSet = new ColumnSet(true);

               phonecall.AddAttributeValue("from",Guid.Empty);

               phonecall.AddAttributeValue("directioncode",0);

              EntityCollection retrieved = _service.RetrieveMultiple(phonecall);

    but it doesn't work..

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at
    RE: Select all phonecalls where "From" is null

    Hi,

    In order to query party list fields, see the link below.

    https://community.dynamics.com/crm/b/crmshafraz/archive/2009/08/19/querying-a-partylist-field

  • Verified answer
    Thomas David Dayman Profile Picture
    11,323 on at
    RE: Select all phonecalls where "From" is null

    You can use the FetchXML Builder in the XRM toolbox and save it as a C# QueryExpression

    http://prntscr.com/f1sh4r

    // Instantiate QueryExpression QEphonecall

    var QEphonecall = new QueryExpression("phonecall");

    QEphonecall.Distinct = true;

    // Add columns to QEphonecall.ColumnSet

    QEphonecall.ColumnSet.AddColumns("subject", "statecode", "prioritycode", "scheduledend", "createdby", "regardingobjectid", "activityid");

    QEphonecall.AddOrder("subject", OrderType.Ascending);

    // Add link-entity QEphonecall_activityparty

    var QEphonecall_activityparty = QEphonecall.AddLink("activityparty", "activityid", "activityid");

    QEphonecall_activityparty.EntityAlias = "aa";

    // Define filter QEphonecall_activityparty.LinkCriteria

    QEphonecall_activityparty.LinkCriteria.AddCondition("partyid", ConditionOperator.Null);

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Select all phonecalls where "From" is null

    Download the FetchXML from advance find. Then use below to get records

    service.RetrieveMultiple(new FetchExpression("fetchxmlstring");

  • EmployeeOcta Profile Picture
    6 on at
    RE: Select all phonecalls where "From" is null

    Hello Anatoliy,

    what the error you are getting in this.?

  • Anatoliy Veshemirsky Profile Picture
    on at
    RE: Select all phonecalls where "From" is null

    I have an issue: how I could debugging custom workflow activity? As variant - create console application with same code.. May be you know better cases?

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Select all phonecalls where "From" is null

    Anatoliy,

    That should help - ssharmacrm.wordpress.com/.../how-to-debug-a-custom-workflow-activity-in-dynamics-crm

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans