You need to sign in to do that
Don't have an account?
ForceRookie
Batch that will update contact field based on custom settings
Somebody please help me on how to update Contact’s field value if I subtract two Custom Setting’s fields?
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi Rookie,
How will you trigger Contact on changes of Custom setting, we cannot write trigger or class based on the custom setting.
You need to put it in Object that can throw some event on the update of records.
Thanks,
Gaurav
Skype: gaurav62990
How will you identify which records should get updated with the value stored in both Custom setting? I can understand, you have two custom setting
- The first custom setting contains a field API name and the value.
- The second custom setting has field Decay API name and the value.
Thanks,Gaurav
Skype: gaurav62990
There might be 100 or 1000 or lacs of Contact records in org, how will you identify the single or list of records to get updated based on the custom setting?
In batch:
//Cacluate score value.
Integer cs1 = myfield.getValue(Score__c);
integer cs2 = Decay.getValue(decay);
Query Contact
List<Contact> contactToUpdate = new list<Contact>();
for(contact c :[SELECT id, Score__c FROM Contact])
{
c.score__c = cs1-cs2;
contactToUpdate.add(c);
}
update contactToUpdate;
Hope this helps you to identify your solution.
Thanks,
Gaurav
All of the Contact will be updated since all of those have Score__c field.
I’m just curious on how can my batch will
identify that I’m getting the value from custom settings and update the Contact field.
Thanks for the reply!
Will update you later after I test the batch.
Did you get any updated on this.
Thanks,
Gaurav
I have already figured out the answer for this. But thanks btw.
Will it be possible to delete my unresolved questions here?