• unid
  • 5 Points
  • Member since 2010

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 0
  • 1

i want to ask, How to make <apex:iframe> height to be dynamic?


<iframe width="100%" height="500px" align="top" frameborder="0" src="{!srcIframe}">


I already used height="auto" etc, but unsuccessfull..

Any suggestions?


  • September 05, 2011
  • Like
  • 0

I am trying to use Test.loadData to load parent and child records linked by the Master Detail relationship.


I have been referencing the follwoing:











However, none of these solve the problem.   Here is what I have done:


1)  Added an External ID field on both Parent and Child  "Load_Key__c"

2)  Created an Extra field on the Child, which holds the value of the External Id on the Parent. "PG_Load_Key__c"


Here is where things are not working.  



If I follow the examples, they instruct to do the Test.loadData with both Parent and Child.  Then, create a Map from the parent, setting the respective refernce.   This is where things fall down.  If I try the lodData on the child, with the Parent Reference empty, I get the error "Required fields are missing"


Therefore, I cannot get past the loadData on the child to add the references to the Parent.



I tried just putting the Parent's External ID value into the Mater Detail field of the child and I get the error:  "Invalid ID value"



I can load this data in the Data Loader using the External ID, (that does not help me with my test scripts).  I use a modified map file with the syntax: PG_Load_Key__c=Product_Group__r\:Load_Key__c


I have tried naming the field to see if it can leverage the same syntax, but it fails for these optons:







So, I am stuck.  I cannot load the child without the Parent Key.  I cannot modify the static resource file to put the key in at runtime.  I cannot find a way to have SF do the lookup on the External ID of the Parent.


How can anyone load Child (Master Detail) record with the Test.loadData()?


I have a complex object graph with about 8-10 objects with mutiple layered lookups and Master Details.


Has anyone accomplished this?




In the User's Guide there is a sample http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_test.htm?CSHID=apex_methods_system_test.htm#TestLoadDataExampleSection

of how to use the Test.loadData method to load a csv file with Accounts.


I cannot see any documentation nor samples showing how to load records with references (lookup or master-detail) to parent records - e.g. if I want to load Contacts, which refer to Accounts.


Anyone who knows. I suppose I am not going to "invent" record IDs????