locked
Adding Find Field to Lookup View not working. RRS feed

  • Question

  • I have added a find field to the invoice and contract entities.   I have added the invoicenumber and contractnumber fields to the find field on the respective lookup views in the entities.  I have publlished them.  But when I try to do a lookup using the invoicenumber or contractnumber, it never can find it.  I have to resort to using the name field that was the default setting.  Any ideas as to why this would not work?
    Friday, September 4, 2009 4:17 PM

Answers

  • That is where the problem was.  The contracts have already been invoiced, so they are "Active" contracts, as upposed to canceled, expired and such.  But for the statecode, they are not active, since they have been invoiced.  But they need to be created and invoiced, and that is the problem because once they are invoiced, we could not pull them up to attach to the invoice.  So we would have to create the invoice, but do not mark it paid, and then create the contract, but do not invoice it, then attach the contract to the invoice, then invoice the contract, then make the invoice as paid.  A really convoluted way to get around. 

    I wound up finding that if I entered the following line in the on-load event of the invoice form, then when I clicked on the lookup for the contract, it would display all contracts, even invoiced ones.

    crmForm.all.new_contractid.lookupclass = "alllookups";

    Thanks for everyones help.
    Tuesday, September 8, 2009 9:35 PM

All replies

  • can you make sure you have added the contractnumber in "Quick Find All Contracts"? this is the view which gets displayed when you put any value in search box...

    I think you might have added this find column in 'Contract Lookup view' which gets displayed when you go for setting referacning contract from other entity (like from case screen when you set contract)...

    hope this helps ..
    Friday, September 4, 2009 9:54 PM
    Answerer
  • Yes, I did put it in the lookup view, because that is where I am trying to find/lookup the value.  We have a reference on our contract to the invoice number so we can track what invoice the contract was paid for by.   Sorry if I was confusing when calling it a find field, but that is what they call it when you modify the lookup view.
    Tuesday, September 8, 2009 4:26 PM
  • Have you put the contractnumber field as find field on "Quick Find All Contracts" view ??
    Tuesday, September 8, 2009 4:31 PM
    Answerer
  • Yes, it is in the quickfind.  But as I said, I am not trying to do a quickfind from the top of the contract window.  I am clicking on the contract field on the invoice form that is a reference to the contract that is associated with the invoice.  It brings up the Lookup for contracts.  I put the contract number in the field to search, click the maginifying glass, and do not get anything.  If instead I put the name of the contract, it can find it.
    Tuesday, September 8, 2009 4:40 PM
  • Lookup fields placed on forms are restricted to certain values when you build the relationship and add the linking field to the form.  It sounds like the system is working as designed based on what I understand.

    You added a relationship between Contracts and Invoices
    You added the Contract lookup field to the Invoice

    You will be able to search on the Contract Title when accessing the lookup field from the Invoice form and not the Contract Number or other value.  You will need to add some custom code to extend the application to allow other lookup values. 


    Best Regards, Donna
    Tuesday, September 8, 2009 5:40 PM
  • Then what is the find column in the configuration of a lookup view?  There is a view column and a find column.  It was always my understanding that the find column was the way that you could modify which fields it looked for the search string?
    Tuesday, September 8, 2009 5:46 PM
  • I may have spoke too soon.  It seems to work when the contract is in draft status.  If I click on the contract lookup on the invoice, and put in a contract number for a contract that is in draft status, it will find it.  As soon as I activate the contract, it no longer can find it in a lookup either by the contract number or name.  Why would it not find a contract that is active?

    Tuesday, September 8, 2009 5:53 PM
  • Maybe we are talking about two different things.  I think I understand where you are in the application now.  Try this, on the invoice entity only, add the View column for Contract ID and ensure you have the Find column added as well, which it sounds like you do.  Adding the view column will help us ensure that the publishing is working as expected.  If you see the view column when you select the contract lookup from the Invoice record, then we know it is publishing as expected. 

    What entity do you associate with Invoice for the Customer field?  Is it Account, Opportunity or Order and do you associate your Contracts with Accounts or Contacts?


    Best Regards, Donna

    Tuesday, September 8, 2009 6:19 PM
  • Quick Finds and Lookups only work on Active Records.  This terminology can be confusing since a contract is Active once it is started.  Basically if you can't edit any of the fields on the form, you won't be able to find that record in a quick find or lookup.  There are ways around this but they will affect all queries for that entity type.

    This blog entry should provide insight:  http://ryandev.com/how-to-include-inactive-records-in-microsoft-crm-40-quick-find/
    Tuesday, September 8, 2009 6:44 PM
  • Also, make sure your Contract is in Active status and not invoiced or some other status that is not available through the Lookup feature.


    Best Regards, Donna
    Tuesday, September 8, 2009 7:05 PM
  • That is where the problem was.  The contracts have already been invoiced, so they are "Active" contracts, as upposed to canceled, expired and such.  But for the statecode, they are not active, since they have been invoiced.  But they need to be created and invoiced, and that is the problem because once they are invoiced, we could not pull them up to attach to the invoice.  So we would have to create the invoice, but do not mark it paid, and then create the contract, but do not invoice it, then attach the contract to the invoice, then invoice the contract, then make the invoice as paid.  A really convoluted way to get around. 

    I wound up finding that if I entered the following line in the on-load event of the invoice form, then when I clicked on the lookup for the contract, it would display all contracts, even invoiced ones.

    crmForm.all.new_contractid.lookupclass = "alllookups";

    Thanks for everyones help.
    Tuesday, September 8, 2009 9:35 PM
  • Great, I am glad you found a solution. 
    Best Regards, Donna
    Tuesday, September 8, 2009 9:44 PM