Skip to main content

Notifications

Dynamics 365 Community / Forums / Field Service forum / Cascading lookup in fi...
Field Service forum

Cascading lookup in field service mobile application

Posted on by 6,203

Hi All,

Is there any way we can set cascading lookup in field service mobile application by using OOB or javascript?

Any help would be appreciated.

Thanks,

Shahbaaz

  • Shayan Soheili Profile Picture
    Shayan Soheili 940 on at
    RE: Cascading lookup in field service mobile application

    Hi Shahbaz,

    Did you apply correctly the filter on Contact field?

    In my case, I can see all contacts associated to the selected Account on lookup field and not just primary contact.

    12.PNG

    12.PNG

    Check also if there is any additional filter applied on the view in contact entity. 

    Regards,

    Shayan

  • Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Cascading lookup in field service mobile application

    Hi Shayan,

    It is just showing me the primary contact in the filter contact lookup, but i want all the related record to that account, not just the primary contact.

    Thanks,

    Shahbaaz

  • Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Cascading lookup in field service mobile application

    thank you very much for the answer

  • Verified answer
    Shayan Soheili Profile Picture
    Shayan Soheili 940 on at
    RE: Cascading lookup in field service mobile application

    Hello Shahbaz,

    Please follow these steps,

    In my case I have two fields for Account (Account & Account2) and two fields for Contact (Contact & Contact2), I just filtered the field Contact2 based on the field Account2. 

    1- In Woodford, double click on the field that you want to filter. 

     5707.4.PNG

    2- Click on "Edit Filter"

    7026.2.PNG

    3- Insert the condition, (Company Name on contact form is a lookup on Account entity)

    5633.3.PNG

    4- In the Select entity field, click on "Set Variable"

    5707.4.PNG

    5- and Select the preferred Account field.

    5.PNG

    6- Save and Publish

    In my case, once I select a value for Account2, then the field Contact2 shows me just those contacts associated to Account2.

    You can apply the same filter also for your Account1/Contact1

    Hope this helps,

    Regards,

    Shayan

  • Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Cascading lookup in field service mobile application

    1106.8738.Lead-screen.PNG

    I Have two lookup Account(Partner account) and contact(Partner contact), on selecting of account i need to filter contact(it show display contact related to that account selected)

    Regards,

    Shahbaaz

  • a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: Cascading lookup in field service mobile application

    Can you please provide screenshot what exactly do you need?

  • Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Cascading lookup in field service mobile application

    i tried below javascript, it filter the record and show in popup, but i dont want popup,

    // var lookupForm = new MobileCRM.UI.LookupForm();

    // // HOW TO ADD ADDITIONAL FILTERING TO LOOKUP FORM.

    // var customXMLView = "<fetch version='1.0'><entity name='contact'><filter type='and'><condition attribute='parentcustomerid' operator='eq' value='"+ account_id +"'/>"+

    // "</filter></entity></fetch>";

    // lookupForm.addEntityFilter("contact", customXMLView)

    // lookupForm.addView("contact", "Default");

    // lookupForm.allowNull = true; // Allow choosing empty value

    // lookupForm.show(function(accountRef)

    // {

    // /// <param name="accountRef" type="MobileCRM.Reference"/>

    // // Change the parent customer on currently edited contact entity

    // MobileCRM.UI.EntityForm.requestObject(

    // function (entityForm) {

    // /// <param name="entityForm" type="MobileCRM.UI.EntityForm"/>

    // var editedContact = entityForm.entity;

    // var newContact = accountRef ? new MobileCRM.Reference(accountRef.entityName, accountRef.id, accountRef.primaryName) : null;

    // editedContact.properties["ewt_partnercontact"] = newContact;

    // },

    // MobileCRM.bridge.alert

    // );

    // }, MobileCRM.bridge.alert, null);

  • Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Cascading lookup in field service mobile application

    thanks Andrew for the reply,

    is there a way to do it by using javascript?

    here i have two entity account and contact, on selecting account from lookup i need to filter contact lookup.

    Thanks,

    Shahbaaz

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: Cascading lookup in field service mobile application

    Hello,

    Do you mean filtered lookup? If yes - you can use OOB approach - sumedha8.blogspot.com/.../filtered-lookup-in-resco-mobile-app.html

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

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,802 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,129 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,154

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans