Topic
  • 3 replies
  • Latest Post - ‏2013-05-16T17:06:17Z by KaranBal
HoelTREGUIER
HoelTREGUIER
2 Posts

Pinned topic Script on view change

‏2013-05-14T15:16:59Z |

Hi,

 

I'm looking for a way to run a wpcs script when a user changes the view of an item but i can't find anything.

 

Thanks for your answers,

Best regards,

 

Hoel

  • KaranBal
    KaranBal
    108 Posts

    Re: Script on view change

    ‏2013-05-15T23:10:25Z  

    All the extension points where a script can be plugged into the product are present in the following link: http://pic.dhe.ibm.com/infocenter/mdm/v10r0m0/topic/com.ibm.pim.app.doc/code/add/pim_con_launchpoints.html.

    As per your use case, the most appropriate one may be the UI refresh script: http://pic.dhe.ibm.com/infocenter/mdm/v10r0m0/topic/com.ibm.pim.app.doc/code/pimscript/pim_ref_uirefreshscript.html

    I have never used this script before but I think it may meet your need because whenever you change the view, the item edit screen is refreshed meaning this script may be executed(I have not tested it). Then you can have code in place checking to see whether the view is the default one (getDefaultCtgViewName) or not or if it has changed and then code your logic as per your business need. Link to ctgView functions: http://pic.dhe.ibm.com/infocenter/mdm/v10r0m0/topic/com.ibm.pim.sop.doc/scripts/pim_ctgviewcontainer.html

  • HoelTREGUIER
    HoelTREGUIER
    2 Posts

    Re: Script on view change

    ‏2013-05-16T11:43:24Z  
    • KaranBal
    • ‏2013-05-15T23:10:25Z

    All the extension points where a script can be plugged into the product are present in the following link: http://pic.dhe.ibm.com/infocenter/mdm/v10r0m0/topic/com.ibm.pim.app.doc/code/add/pim_con_launchpoints.html.

    As per your use case, the most appropriate one may be the UI refresh script: http://pic.dhe.ibm.com/infocenter/mdm/v10r0m0/topic/com.ibm.pim.app.doc/code/pimscript/pim_ref_uirefreshscript.html

    I have never used this script before but I think it may meet your need because whenever you change the view, the item edit screen is refreshed meaning this script may be executed(I have not tested it). Then you can have code in place checking to see whether the view is the default one (getDefaultCtgViewName) or not or if it has changed and then code your logic as per your business need. Link to ctgView functions: http://pic.dhe.ibm.com/infocenter/mdm/v10r0m0/topic/com.ibm.pim.sop.doc/scripts/pim_ctgviewcontainer.html

    Thank you for your response, but sadly the view change doesn't trigger the UI_REFRESH_SCRIPT but the refresh button does :-/

    is there a similar script like : VIEW_CHANGE_SCRIPT or something ?

    My probleme is that there is no restriction to the view selection and I want to have : "Admin_View", "Reader_View", "User_View"

  • KaranBal
    KaranBal
    108 Posts

    Re: Script on view change

    ‏2013-05-16T17:06:17Z  

    Thank you for your response, but sadly the view change doesn't trigger the UI_REFRESH_SCRIPT but the refresh button does :-/

    is there a similar script like : VIEW_CHANGE_SCRIPT or something ?

    My probleme is that there is no restriction to the view selection and I want to have : "Admin_View", "Reader_View", "User_View"

    There isn't a way to plug a script in directly, and the closest thing that comes to mind is specifying a script in data_entry_properties.xml file. But the trigger actions for it are save, refresh, revert, and categorize.

    Link: http://pic.dhe.ibm.com/infocenter/mdm/v10r1/topic/com.ibm.pim.cof.doc/properties/pim_ref_cp_dataentryprops.html

    The access for users is controlled by groups and ACGs while the views do not have ACG associated with them meaning all users can view them, possible. I looked for a way to assign ACGs to views via code but didn't find the right operation; link:

     script: http://pic.dhe.ibm.com/infocenter/mdm/v10r1/topic/com.ibm.pim.sop.doc/scripts/ctgview/pim_cvw_ctgviewcontainer.html

    Java: http://pic.dhe.ibm.com/infocenter/mdm/v10r1/topic/com.ibm.pim.java.doc/com/ibm/pim/view/package-frame.html

    You should create a new PMR to request an enhancement or for detailed analysis by the support team on whether this can be achieved. Link to open PMR: https://www-947.ibm.com/support/servicerequest/