I’m having some troubles passing URL parameters to a page include.
Here’s the example:
I have a page called TaskLogCall that accepts parameters to populate WhoId and WhatId
On my contact detail page, I create a popup with a page include that includes the TaskLogCall page.
In the field for setting the querystring, I pass in the parameters required using the same format as on this documentation page.
Expected result: beautiful pre-populated fields in my pop up.
Actual result: painful emptiness.
What am I doing wrong?
Does the page you’re calling the page include from already have a URL parameter Id? Not sure this would cause an issue though.
It does indeed have an “id” condition on the main contact model. But I would thank that a page include would be like it’s own self-contained little universe, no?
Not sure, but it’s quick to test that.
Hmm, how would I do that without breaking my contact detail page though? Or do you just mean giving it a distinct parameter name so the two don’t potentially mix up?
I may not be up to speed on this, but does this page include have model to handle the contact and account? The models will need to be loaded prior to the task model in order to properly set the task whoid and whatid to the id of the current contact and account model.
Change the page include page model condition name to whoid vs just id. Then update the query string to reflect that change.
Hi Pat, yep the page has those models and works fine when used as a stand-alone page. Just can’t get the parameters to pass into the include.
OK thanks. Have to step away for a bit but will give that a try.
Try passing them into simple text fields to see if they arrive at all.
Rob was saying something about the 15 vs 18 characted id being an issue. Not sure if that applies here.
Have you inspected the generated URL? Does it contain what you coded and expect? You may need to open Chrome Developer tools to see it since it is a page include in a pop up.
This possible? To get the URL of the page include? How?
On second thought, maybe not, if the pop up is included in the initial page load. Open Developer tools and check out the network log entries when opening the pop up. You can also review page source. I have not tried this and maybe way off base. Just thinking out loud.
I always think out loud. It’s very noisy! :Pat
Assuming that you have a Model called “Contact” on your Contact detail page, you could use this as the Query String instead:
This is more explicit.
But the problem with the above may be Capitalization, if your parameter in the URL ends up as lower-case “id” or lowercase “accountid”, then your Query String has to use Lower Case as well, that is:
I tried the more explicit method, only changing the name of the model to ContactData to reflect my model name.
This is what I have now:
This is what I get on my popup page include now
The WhoID is working fine.
The WhatID is passing but not being converted to a name for some reason.
Furthermore, the page is now displaying this error:
Note both the original page (ContactDetail) and the included page (TaskLogCall) contain Account and Opportunity models with name and ID fields.
How to fix?
Irvin that is a good idea. I can’t find the actual querystring in the HTML of the page though unfortunately. It looks as though maybe the actual URL is not rendered in the pop up so I can’t find it in the inspector (unless I’m missing it).
Odd. The SOQL query doesn’t have the value in it but it shows up in the page.
I would recheck the capitalization of the query parameters.
I would make sure that your Model Conditions, which are probably of type URL Parameter, are expecting the revised parameter names, in lower-case.