You need to sign in to do that
Don't have an account?
Tillu
Please Correct this below code ?
I have Market , Business custom objects. Market is Master object and Business is child object. So Market has any no of Business records in its related list.
Now i want to update a Market object field , if Market has No Business Records. It is Text field. Can any one correct the below field ? I am getting error on sowl statements.
trigger MarketChange on Market__c (before insert,before update) {
set<id> Pset = new set<id>();
for(Market__c py : Trigger.new){
Pset.add(py.id);
}
List<Market__c> Ltf = [select id,(select id,Market__c from Business__r ) from Market__c]; // Error Here
if(Ltf.size() > 0){
for(Market__c px : Trigger.new){
px.ResultField__c = 'No Business data';
}
}
}
Error : Compile Error: Didn't understand relationship 'Business__c' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 8 column 17
Now i want to update a Market object field , if Market has No Business Records. It is Text field. Can any one correct the below field ? I am getting error on sowl statements.
trigger MarketChange on Market__c (before insert,before update) {
set<id> Pset = new set<id>();
for(Market__c py : Trigger.new){
Pset.add(py.id);
}
List<Market__c> Ltf = [select id,(select id,Market__c from Business__r ) from Market__c]; // Error Here
if(Ltf.size() > 0){
for(Market__c px : Trigger.new){
px.ResultField__c = 'No Business data';
}
}
}
Error : Compile Error: Didn't understand relationship 'Business__c' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 8 column 17
You can refer below code:
Replace Market_lookup__c with API name the lookup field.
If this solves your problem, kindly mark it as the best answer.
Thanks,
Vatsal
All Answers
You can refer below code:
Replace Market_lookup__c with API name the lookup field.
If this solves your problem, kindly mark it as the best answer.
Thanks,
Vatsal
This is the field which creates the lookup realtion between two objects,
so replace the Market_lookup__c with API name of that field in the above code.