Custom object search in Salesforce Lightning - salesforce

To create child record, I use e.force:createRecord but when I type the name of parent record into look-up field, it shows nothing even whole name or some letter.
I want to have the functionality as standard object like contact:
Do I need to config somewhere?

I believe Lightning shows only recently accessed records.
To have more flexibility you might need to create a completely custom component which would include custom lookup.
For my case I used custom components with custom lookup with similar approaches to this post or this one

Related

Accessing CustomFieldDefinition metadata via tooling api

So, I've been attempting to gather picklist dependencies per Opportunity record type for my lightning components. I have been able to retrieve Standard Field dependencies by RecordType, but it the Tooling API will not return the custom field dependencies. Standard calls and queries will not work either, as they state that the field has no controlling value or dependency.
Given this information I suspected that there was a table that is hidden somewhere that contains the keys for the RecordType and FieldDefinition, hopefully with a nested Metadata object.
I found an Id in one of the parameters in the setup menu for a Record Type and Id.getSObjectType() on it. The table name is CustomFieldDefinition. However, it is not accessible via SOQL or the Tooling API.
Has anyone accessed this table? Or has anyone been able to retrieve the field-record type picklist dependencies on custom fields AND standard fields?Tooling API ResponseDebug Log with SObject Name
I think you're doing it wrong.
"Controlling field" would be another picklist or a checkbox for example, something you change during same edit action. If you have dependency to record type - in that sense it's not a controlling field. Sure, you change record type and picklist changes - but really everything would change, it should be a different page layout (different fields shown, marked readonly/required etc). There's a reason that record type change is not done on normal edit screen, you do it by clicking special link on detail view and then everything "explodes".
Have a look at "User Interface API" - set of tools meant to help your custom app (mobile? desktop?) steal recreate a normal page layout. This one might be especially useful: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_picklist_values_collection.htm
There's even a Trailhead: https://trailhead.salesforce.com/en/content/learn/modules/user-interface-api (skim through whole set but especially read last module)
And since you mentioned Lightning Components - are you aware of these ready tools:
https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_ui_api
getPicklistValuesByRecordType
https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_generate_record_input_create
or maybe you don't have to code it all and stuff like <lightning-record-edit-form> with recordtypeid passed to it will solve all your problems
Have a look, if I didn't give you a working solution then at least you have some keywords to Google around. If you're still stuck - try to post a code sample as new question?

Is it possible with an ADF ComboBox component to type in values not present in the given LOV?

I am working on an input form using ADF. I have an input field in which I want to show a list from which the user can select the value and also require a type option in case the value user want is not in the list.
I use the JDeveloper 12.2.1.3 for development. I have tried using ADF ComboBox component based on a static list. The component gives a list a expected. But I cannot type in a new value in case the value I wanted is not in the list. I can only type whatever is in the list already.
I am looking for something similar to the HTML input-datalist combination which gives a list and allows type if the intended value is not in the list.
The InputListOfValues and other LOV components only allow you to enter data which is present in the list. That is the way these components are designed. It would not make sense to allow other input as you normally use such components in places where you want to make sure the user can only input reference data defined in other data.
Anyway, it's easy to create some kind of component which allows you exactly what you want. I wrote a blog n this here https://tompeez.wordpress.com/2013/02/03/jdeveloper-11-1-1-6-0-afinputtext-with-self-made-look-up-not-using-lov/
From this page you can download and run the ADF Faces Rich Client Demo, which shows all components and what they do.

Adding fields to a Junction Object from one of the Master-Detail relationships

In a Salesforce Junction object can I reference fields from the two Master-Detail relationships in formulas and/or the User Interface or am I going to have to switch to Apex code? I can write the apex, but I try to use the built in tools as much as possible :).
To use the examples from the Trailhead tutorials I have
1. A Job Position Object (Project Mananger, Sr Developer, etc).
2. A Posting Website Object (Monster.com, Dice.com, etc).
3. A "Job Posting" Junction Object to link the two.
Let's say I add a field to the Job Position Object called "Close Date" to keep track of the date the position closes. Can I display this field on the layout page of the Job Posting Junction object without using Apex code and/or a custom VisualForce page?
Thanks!
You can definitely do that. You can use a formula field and just reference the relationship name of the object and the field name (so for example something like Job_Position__r.Close_Date__c), or if you prefer you can use the "Insert Field" button when creating the formula which will allow you to select the object/field you want through the UI.

Create new field type for custom content

I want to create a new content type called "Message". It will have a couple of fields, "message-body" which will be plain text and "addressees". The addressees field should reflect a list of the registered users of the site.
The idea is to create a field type that will be a checklist where all users of the site can be selected, and those that are will receive the message in "message-body" via drupal_set_message($msg).
I am not suceeding so far in creating a custom field type. The Field API documentation is not very clear.
Thanks.
You maybe already found the solutions for you problem.
I think in your case you can use Entity Reference. In your custom content type you can create a new field with the Entity Reference type. Then on the configuration page you can choose which entity to reference, like node, taxonomy or users, with different types of widget.
Here's a link of the Entity Reference module.
Why not make a content type via the menu interface www.yoursite.com/admin/structure/types/add.
Or you need it as a module that you can re-distribute?
An easier way then is to make use of features. It allows you to 'export' a built content type into a module. Enabling the module (on another site), then creates all the fields that where in the export.

Save error: Initial term of field expression must be a concrete SObject: MAP<String,AcctId__c>

I'm trying to get over a limitation in Salesforce where Lead objects can't have related lists that convert with the Lead over to Opportunity, Contact and Account. I have set up 4 objects of type Lookup Relationship, and created a dummy record in each.
I want to use Custom Settings to store the id of each of these dummy records, so that when the Lead converts, any custom objects can also convert to objects with Master/Detail relationships on the respective standard objects.
My trigger on Lead(after update) tries to create a Map of the Custom Settings:
Map cs = AcctId__c.getAll();
AcctId__c is the Custom Setting api name. Compile time is giving me the above message.
Now, I copied this code directly from the Salesforce documentation. What am I forgetting?
I believe that you must include the actual map definition <String,AcctId__c> after the word Map.
Check out this page.
http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_collections_maps.htm

Resources