You need to sign in to do that
Don't have an account?
Preeti Khanna 10
Update count on custom object based on records created in asset object with status as installed
I have a custom Object in which I have a field user and added a field to display no. of assets(for count) created by user in asset object where status is installed.
Like if I have 5 assets created by user A whose status is installed then in custom object field it should be updated as 5.If any of the asset is deleted/updated then it should updated. the count as well.
Same way if user B has 3 assets whose status is installed then for User B in custom object in count field it should show as 3.
Request you to help on priority as I am new to salesforce.
Like if I have 5 assets created by user A whose status is installed then in custom object field it should be updated as 5.If any of the asset is deleted/updated then it should updated. the count as well.
Same way if user B has 3 assets whose status is installed then for User B in custom object in count field it should show as 3.
Request you to help on priority as I am new to salesforce.
Please check this code.
Trigger : Controller :
Thanks,
Dhanya
Thanks for your help!
Above code is not working and giving compilation errors as well.
I have one query..Please suggest whether we need to write code on asset object or custom object becuase in my case there in no lookup relationship between the two.
I need to update count field on custom object when user is selected and start date and end date is entered by user.Then system will go to asset object and will match user name and filter date field on asset object with startdate date and end date field of custom object.Count field will be updated when user selects startdate and end date in object/when asset is updated in specified date period by a specified user..
Because asset status changed to installed suppose on 5th May but in custom object there was no record to calculate no. of records.
Now if in custom object on 31st May user make a record with start date as 1 st may and end date as 31st may to find no. of assets which are installed between 1st may and 31st may so that in count field count will be updated for assets where status is installed between 1st may and 31st may.
I feel we need to write trigger both on asset and custom object.
Please help and waiting for a reply from your side.
Regards,
Preeti