function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Santosh Shahi04807505290019439Santosh Shahi04807505290019439 

Didn't understand relationship 'Merchandise__r' in field path. 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.

Best Answer chosen by Santosh Shahi04807505290019439
sfdc_ninjasfdc_ninja
Well do you have a custom field on the Line Item object that refers to the Merchandise object?  Is that field have an API name of Merchandise__c?

All Answers

sfdc_ninjasfdc_ninja
Please share your code.  Its near impossible to help with just that error message, need the corresponding code that caused the error.
Santosh Shahi04807505290019439Santosh Shahi04807505290019439
trigger HandleProductPriceChange on Merchandise__c (after update) {
List<Line_Item__c> openLineItems =
[SELECT j.Unit_Price__c, j.Merchandises__r.Price__c
FROM Line_Item__c j
WHERE j.Invoice_Statements__r.Status__c = 'Negotiating'
AND j.Merchandises__r.id IN :Trigger.new
FOR UPDATE];
for (Line_Item__c li: openLineItems) {
if ( li.Merchandises__r.Price__c < li.Unit_Price__c ){
li.Unit_Price__c = li.Merchandises__r.Price__c;
}
}
update openLineItems;
}







}
sfdc_ninjasfdc_ninja
It looks like your custom object is Merchandise__c, so the related object in this case would be Merchandise__r (not plural).  You are using Merchadises__r (Plural).  Try taking away the 's' and use Merchandise__r.
Santosh Shahi04807505290019439Santosh Shahi04807505290019439
Ninja its not working..i have checked aout all thing but ist same problem
trigger HandleProductPriceChange on Merchandise__c (after update) {
List<Line_Item__c> openLineItems =
[SELECT j.Unit_Price__c, j.Merchandise__r.Price__c
FROM Line_Item__c j
WHERE j.Invoice_Statements__r.Status__c = 'Negotiating'
AND j.Merchandise__r.id IN :Trigger.new
FOR UPDATE];
for (Line_Item__c li: openLineItems) {
if ( li.Merchandise__r.Price__c < li.Unit_Price__c ){
li.Unit_Price__c = li.Merchandise__r.Price__c;
}
}
update openLineItems;
}







}
sfdc_ninjasfdc_ninja
You are getting the same error?  Or is it a new error?
Santosh Shahi04807505290019439Santosh Shahi04807505290019439
ya same error
sfdc_ninjasfdc_ninja
Well do you have a custom field on the Line Item object that refers to the Merchandise object?  Is that field have an API name of Merchandise__c?
This was selected as the best answer
Santosh Shahi04807505290019439Santosh Shahi04807505290019439
Thanks ninja...problem in my custome field..when create a relationship between LIne item and merchandise (master detail relation).where i right mearchise replce to Items...


Thanks u very much
Santosh Shahi04807505290019439Santosh Shahi04807505290019439
Hi , I'd like to add you to my professional network on LinkedIn. - santosh Accept: http://www.linkedin.com/blink?simpleRedirect=18pD9ys5lWlPRVpkJApn9xq7cCe3gQd30NdzkUdPkNc34Te3AUdjR4imVLqnhxt6BSrCACt7dBtmtvpnhFtCVFfmJB9C5QoORBt6BSrCAJt7dBtmsJr6RBfmtKqmJzon9Q9ClQqnpKimtBkClOs3Rx9CAQbnFCqSZKcDBEbn1Gpj4Vd3RBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I7542572030_1&markAsRead= You are receiving Invitation emails. Unsubscribe here: http://www.linkedin.com/blink?simpleRedirect=1JrSd5cylBoT9LpDdBr65Phj8BsClQt65EoQkO9j0NomV5cylFomRHqPkRbmp5cylIr6pQqAkO9jlBrC5ycmRAoT4MuCJAcD0Md2lEc75QqzkTu35KpThLrTFFhj8BpC5Ip6xKc6tIu6lCrztyd3RIqm5JpipFd2RWpCJLrz9Vq2RMqCkNejgZp6BB9CZGq7lGrSxErCgOp39DdzRAqm4CciQZp6BJ9z4Sc30OfmhF9DhPpnlDnSlQqnpKqjRHpipBoCBOoTdytndKtiRBt6BSrCAJt7dBtmsJr6RBfmtKqmJzon9Q9B4ScSh5hSxmhD9JhB51fmVBqSZkp6BJ9DdKtjRQ9CAQbnFCqSZKcDBEbn1Gpj4Vd3RBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I7542572030_1&markAsRead= Learn why we included this at the following link: http://www.linkedin.com/blink?simpleRedirect=3wUdPgZp4BBr6dFt79x9DhPpnlDnSlQqnpKqjRHpipIsBlBoSBSsCljsClJrThPtmcZoipFd2RWpCJLrz9Vq2RMqCkNejgZpjYOtyZBbSRLoOVKqmhBqSVFr2VTtTsLbPFMt7hE&msgID=I7542572030_1&markAsRead= © 2014, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA