For partners that build or integrate commercially available applications and service solutions with the Oracle Cloud Platform
For partners that provide implementation or managed services around Oracle Cloud Applications
I need to expose ctype_id contact type for the customer portal pages. Any idea?
Comment
Ryan,
The hook is working as I am getting the value saved and retrieved from the session within the model function.
I cannot get the value to the page from the session!!!
Be the first to rate this
|
Sign in to rate this
Ryan,
Somehow the esession get wipe off somewhere. I used the cookie and I can get it to the page now.
Now, I need to be able to pass in teh c_id (contact id) as a parameter of that function. How can I do that?
On you previous post you said that you can pass it by reference but how? Will just &$c_id in the method header be enough?
Thanks,
Be the first to rate this
|
Sign in to rate this
No, pass in &arr and then dump out $arr in the code to see everything in there you have access to. That is what you can utilize in your code in the hook.
Be the first to rate this
|
Sign in to rate this
Ryan,
The question is where to pass in &arr?
so far I have three pieces:
1. The page that displays the data.
2. The hooks.php
3. The model (contact_model_custom)
Where in those I should pass the &arr and how?
Thanks,
Be the first to rate this
|
Sign in to rate this
You pass in the &arr to the function in your custom model which is called by the 'function' attribute in your $RnHooks declaration from hooks.php.
So the file to modify is your custom model. Pass the function (set_ctype in my case) the &arr
From my earlier post
function set_ctype(&$arr)
{
$arr['data'] = ......
//do stuff here and check out what all is in $arr by dumping it out.
}
Be the first to rate this
|
Sign in to rate this
Ryan,
Here is what I added:
function set_ctype(&$arr)
{
print_r($arr); // I am getting 'Array()'
$ctype_id = sql_get_int('SELECT c_id from contacts where c_id = ' . intval($contactID));
}
I am trying to get a c_id (contactId of the current logged in user into this method) passed to the method above.
Be the first to rate this
|
Sign in to rate this
Thats because you are still probably trying this with the pre_page_render hook which has an empty array passed to it. This is what I was trying to point out to you earlier to help with overall understanding of what is going on with hooks. You can determine what data is passed into the hook (into $arr) by looking at the code from where the hook is called. For example, you can see here how the pre_page_render hook is called by the standard page controller (notice the empty array).
$preHookData = array();
RightNowHooks::callHook('pre_page_render', $preHookData);
The post_login hook however is different and actually passes data to the hook. In the standard contact model for example if looks like this
$postHookData = array('returnValue'=>$newProfile, 'data'=>array('source'=>'LOCAL'));
RightNowHooks::callHook('post_login', $postHookData);
So you can see that it is passing data to that hook.
Be the first to rate this
|
Sign in to rate this
Ryan,
When I use the 'post_login' hook I cannot login! Do you know why?
Be the first to rate this
|
Sign in to rate this
Ryan,
When I use the 'post_login' hook I cannot login! Do you know why?
I cannot get it to work with 'post_login' as it hangs in the login screen!!!
Average Rating:



1 rating
|
Sign in to rate this