You need to sign in to do that
Don't have an account?

__r is not working
Asset - Assetid,serialnumber and qty
transaction - tno , Asset(fk)
I want to relate to transaction (Asset) to Asset(serialnumber)
public List<Asset> Incemp {get;set;} ---> I m not using list<> =new list<> , because i added a row...
temp = Incemp.Asset__c - working fine
temp = Incemp.Asset__r.serialnumber__c - not working
Any idea...
transaction - tno , Asset(fk)
I want to relate to transaction (Asset) to Asset(serialnumber)
public List<Asset> Incemp {get;set;} ---> I m not using list<> =new list<> , because i added a row...
temp = Incemp.Asset__c - working fine
temp = Incemp.Asset__r.serialnumber__c - not working
Any idea...
Its like SObject__r.SObject2__r.Fieldname__c where the primary object is the SObject and the related Object is the SObject2.
See the link below for further information.
http://developer.force.com/cookbook/recipe/displaying-fields-from-a-related-record-on-a-detail-page
Regards,
Ashish
You need to retrieve the field on the related object to refer it.
This might help you: List<Asset> lncemp = [select tno, Asset__r.serialnumber__c from Asset];
Thanks,
Y.Srinivas
Actually (public List<Asset> Incemp {get;set;}) using reason is i added a row one bye one..
for(Asset lncemp : [select tno, Asset__r.serialnumber__c from Asset]){
temp = Incemp.Asset__r.serialnumber__c
}
Thanks,
Y.Srinivas
If the suggestion posted by Srinivas does not work can you paste the whole code block so that we can understand properly.
i would like to know the object name on which the trigger is written, how is the other object related and what is the field (Type and name).
Regards,
Ashish