You need to sign in to do that
Don't have an account?
Phani Pydimarry 4
Salesforce - Create index for child records
I have an account and I have multiple child records for this Account.
I would like to create a custom field and then update 1 for the first record created and if another record is created I want a field to populate 2 on the second and so on.
I want to develop this functionality because I want to track first record, second record for our analytics.
Please let me know if this is possible
I would like to create a custom field and then update 1 for the first record created and if another record is created I want a field to populate 2 on the second and so on.
I want to develop this functionality because I want to track first record, second record for our analytics.
Please let me know if this is possible
So you want to keep the number of child records in that custom field. If this is what your requirement is, then you can simply do this with the help of trigger.Please let me know if you need any additional inofrmation on this.
Thanks,,
Abhishek Bansal.
I would explain the scenario again. I need a field on each reacord of child object which would have a Rank as 1 if the record is 1 and Rank 2 if the record is 2.
This field would be helpful for us to track the first sale which was done by the Account holder. I hope I am clear
Thanks ,
Vineeth Pydimarry.
Yes, now your requirement is clear and I have written the trigger for the same. Please take care of the API names and syntax errors and let me know if you face any other issue with this.
Thanks,
Abhishek Bansal.
I have received the null point exception so I have limited my query with 10000 records. Now the record on the object - Order saves but there is no rank which is generated by this process.
You are not filtering the account that you need for setting up the Rank field. I have modifed your code : I assume that the Distributor__c field holds the Account record. Please try with the updated code and let me know if there is any issue.
Thanks,
Abhishek Bansal.