You need to sign in to do that
Don't have an account?
DTRain521
Variable Does Not Exist
Hi,
Need so help with the following code.
tooltip4 needs to reference the public void addUpsellHome. Not sure if I wrote this the best way. What I need from it is to query a custom object, determine which record to return then return the string result to tooltip4.
Code is below:
public void addUpsellHome(String infoPIPCov) { List<PIP__c> returnPIPCov = new List<PIP__c>(); String PIPInfo; String PIPInfoState; tempCovPIP = 'Upsell - EFT'; for (PIP__c pip : [select SystemModstamp, RecordTypeId, PIP_Upsell_Coverage__c, PIP_State__c, PIP_Information__c, OwnerId, Name, LastModifiedDate, LastModifiedById, IsDeleted, Id, CreatedDate, CreatedById from PIP__c where PIP_Upsell_Coverage__c =: tempCovPIP]){ if(pip.PIP_State__c != null) PIPInfoState = pip.Name + ': ' + pip.PIP_State__c + ': ' + pip.CreatedById; else PIPInfo = pip.Name + ': ' + pip.RecordTypeId + ': ' + pip.CreatedById; } if ( PIPInfoState != null) return String.valueOF(PIPInfoState); else return String.valueOF(PIPInfo); } public String tooltip4 { get{ String returnVal = ''; returnVal += ((String) infoPIPCov == null? '[None]': infoPIPCov) + '<br/>'; return returnVal; } set{ tooltip4 = value; } }
Any Help would be great.
Thanks Dwayne
I'm guessing you are seeing some compile errors with this code, e.g. you have return statements in addUpsellHome but that has a void signature indicating there won't be any value returned.
Given your requirement, I believe you should be calling the addUpsellHome method from your tooltip4 get method, so your code needs to change something like the following. I've tried to mark the changes in red. I've not compiled this but it should be close:
All Answers
I'm guessing you are seeing some compile errors with this code, e.g. you have return statements in addUpsellHome but that has a void signature indicating there won't be any value returned.
Given your requirement, I believe you should be calling the addUpsellHome method from your tooltip4 get method, so your code needs to change something like the following. I've tried to mark the changes in red. I've not compiled this but it should be close:
I ended up getting it to work just before I left yesterday. I have found another issue and that is the Information field that I am returning can not have line breaks or the info in the field will not return. Thoughts? BTW I will post your answer as am accepted solution. Thanks you for responding and helping out.