Unable to Track Field History of Custom Fields in Custom Objects - salesforce

I have a custom Object called Billing and a number of custom fields in it.
What I'm trying to do is enable Tracking Field History so that whenever one of these Custom Fields is changed, the change will show up on the history log.
So I went to Setup -> Create -> Objects, select Billing from the list of Custom Objects, select Set Tracking History and check the boxes besides the required Custom Fields.
The problem is that only changes in one of these fields show up on the log, while the rests don't.
Any idea what's wrong? Thanks.

Are you sure that you are checking the fields for which you have enabled History Tracking in the history log?
It seems to be working properly in my org for any custom/standard object.

Related

How do I get the lookup objects field history tracking to show up in the related list of the child object?

I can see in my org that someone has a lookup to opportunity and can get the history tracking of opportunity in the related list of the custom object.
I tried to do it for another custom object and it didn't work.
To replicate this in a scratch org I created two custom objects custom object 1 and custom object 2.
Custom object 2 has a lookup to custom object 1 and I made a field "status" on 1 and turned on the field history tracking on it. While creating the objects object 1 didn't have field history tracking turned on and I turned it on but in the real org its turned on from what I can see.
Here is what I can see. As I have field history tracking turned on for both 1 and 2 I can see history object for both in their respective page layouts under the related tabs.
What I want to see is Custom object 1 's history on custom object 2 under the related list but I can't get it to show up. I can see that people have been successful in my org in doing so.

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?

Missing updated property when using the delta query to track changes on users in Microsoft Graph API

I need to track changes in any property of any user but it is not working for all properties. Here is what I'm doing:
I query the list of users using that request:
https://graph.microsoft.com/v1.0/users/delta
I follow the link in #odata.nextLink then save the link in #odata.deltaLink.
I update the displayName property of a user in Office portal.
I follow the previously saved link. I can see the updated value of displayName among other basic properties of that user.
The problem is that if I do the same with the department property, the user is returned but the new department value is not included in the json.
In the documentation(https://developer.microsoft.com/en-us/graph/docs/concepts/delta_query_overview), it is said:
Updated instances are represented by their id with at least the
properties that have been updated, but additional properties may be
included.
which is not the case here.
I have also tested the jobTitle property which is not working at all, meaning that if I change its value, the delta link does not show any change at all. I suppose it is the same for many other properties..
Is there something I'm doing wrong?
I am able also to reproduce this issue. And event I specify select to display the department property, it still doesn't show in the changing result.
Based on the test, it seems that this property doesn't including in the track changes. If you have any idea or feedback about this REST, you can submit it from this link.

How can I export field level history for a field with tracking enabled?

I want to export a history of changes to a single field on the Account object and have field level tracking enabled on the field.
Any suggestions greatly appreciated.
You'll first have to turn on history tracking for the field by following the instructions given here.
Once you've turned on history tracking for that field, any changes to that field will be recorded on the AccountHistory object. You can view them in the History related list on Account, make a report on Account History where the Field Name equals that field, or download them from the AccountHistory object via the API.

Custom Button to copy data from Opportunity into a related custom object

I have a custom object that is used for product setup that is mapped to an opportunity. It's a one to many relationship - one opportunity maps to many setup objects, but one setup object is only mapped to one opportunity.
Opportunity has some setup fields that need to act as defaults for the related custom object. Unfortunately, I cannot just specify them in a formula - getting an error.
What I would like to do is have a custom button that would allow user to click and copy all of the related setup fields from the opportunity into the custom setup object and then edit them as needed.
Any pointers or sample code are greatly appreciated!
You can achieve this with a custom button on the related list for your custom object on the opportunity detail page.
All of the fields on a standard Salesforce new/edit screen have id's associated with them. You can specify values for fields by using these ids to set GET parameters on your URL. For example if the id on the name field on your opportunity is 'opp3', the following URL will populate the name field on your new opportunity page:
https://na2.salesforce.com/006/e?opp3=Hello+World
You would have to change na2 to the correct server for your org.
The new record page URL contains the 3 character id prefix for your particular object and then '/e'. 006 is the prefix for opportunities. You will have to attempt to create a new record to see what the 3 characters are for your custom object.
You will have to capture the id's of the fields you want to populate on your custom object. You can do this by viewing the source of the new record page. For custom fields these id's will take the form of a Salesforce Id (eg. 00N40000002QhEV).
Create a new list button on your custom object and set the behavior to without header and sidebar and set the source to URL. Build up your URL with id=value pairs separated by '&' using the id you got from the page source and the insert field functionality to select the opportunity fields your wish to add in. You should end up with something like this:
/a0U/e?00N40000002QhEV={!Opportunity.Name}&00N40000002QhEW={!Opportunity.StageName}
a0U should be replaced by the correct prefix for your custom object. Then add your button to the related list for your custom object under opportunity.

Resources