You need to sign in to do that
Don't have an account?
Vanitha Mani
Trigger question..its urgent please anyone help
Hi,
I have a case trigger.when creating a case based on the value given in these fields I need to autopopulate two other fields.
Account--user entered
Product--user entered
system-user entered
Environment --user entered
We need to autopopulate
ticket.productbuild =
Ticket.system version=
These values comes from account.
svc-product-build is another object with lookup account .
Need to fetch values of product build and system version from svc product build object with account as a lookup.
It's very challenging. Can anyone help with this autopopulation of fields
I have a case trigger.when creating a case based on the value given in these fields I need to autopopulate two other fields.
Account--user entered
Product--user entered
system-user entered
Environment --user entered
We need to autopopulate
ticket.productbuild =
Ticket.system version=
These values comes from account.
svc-product-build is another object with lookup account .
Need to fetch values of product build and system version from svc product build object with account as a lookup.
It's very challenging. Can anyone help with this autopopulation of fields
trigger copyAccountMemberinContact1 on Case(before insert, before update) {
List < Id > newOrUpdatedCases = new List < Id > ();
List < account > acclist = new List < account > ();
list <case> casesToBeUpdated = new List <case>();
for (case c: trigger.new) {
newOrUpdatedCases.add(c.AccountId);
casesToBeUpdated.add(c);
}
acclist = [Select AccountMember__c from Account where Id in : newOrUpdatedCases];
System.Debug('newOrUpdatedCases' + newOrUpdatedCases);
System.debug('acclist ' + acclist);
for (integer i = 0; i < casesToBeUpdated.size(); i++) {
casesToBeUpdated[i].Contact1__c = acclist[i].AccountMember__c;
}
}
Try the code snippet for your requirement.
For further reference check this,
https://salesforce.stackexchange.com/questions/40188/autopopulate-case-field-with-related-account-field-value
If it helps you and close your query by marking it as solved so that it can help others in the future
Thanks.
I need to populate the values based on the values given in product and environment field ..it should match here
this is the account where installed product name value should diplay in product build and installed system should get display in system version ..
where this table comes from svc product build object with account as a lookup.