Jump to content
Sign in to follow this  
jonasborg

RESOLVED: menubar PRESET not working

Recommended Posts

In 14.1, I am trying to PRESET a value.

This sets the value: http://my_server/CAisd/pdmweb.exe?OP=CREAT...T=zfield:400010

But when I put it into the menubar it doesn't work:

ahdtop.create_new('cr',0,'','','PRESET=type:I@@zfield:400010')

Thanks for any help on how this would work.

Edited by jonasborg

Share this post


Link to post
Share on other sites

Hi, have you tried to split presets?

'PRESET=type:I', 'PRESET=zfield:123'

Share this post


Link to post
Share on other sites

Split presets work in button form, but am still struggling with PRESETs from a menubar as it relates to presetting a list_* form or a detail_* form value.

Share this post


Link to post
Share on other sites

could you provide full js code from menubar? why not to replace it with one from button which works?

Share this post


Link to post
Share on other sites
could you provide full js code from menubar? why not to replace it with one from button which works?

could you provide full js code from menubar? why not to replace it with one from button which works?

The difference in buttons vs menu is that with the buttons I am creating new records with a preset value, with the menu I am trying to search in context of that preset field on an Incident.

The button code that works - presets the Parent value as well as the zfield value:

CODE

<PDM_MACRO name=button Caption="Create Type O Record[!eaO]" Func="create_new('cr',0,0,0, 'PRESET=type:I', 'PRESET=parent:$args.persistent_id', 'PRESET=zfield:400015','INITFROM=frm002');" hotkey_name="Create Incident[!eaO]" ID=ITIL_INCIDENT>

The menu codes that don't preset a value:

CODE

upd_specific_frame('sd','search_in.htmpl','PRESET=additional_where=zfiled:400015')

upd_specific_frame('sd','search_in.htmpl','PRESET=zfiled:400015')

upd_specific_frame('sd','list_in.htmpl','PRESET=additional_where=zfiled:400015')

upd_specific_frame('sd','list_in.htmpl','PRESET=zfiled:400015')

Edited by jonasborg

Share this post


Link to post
Share on other sites

oh, there should be QBE vars,

example : 'QBE.EQ.zfield=400015'

preset is for new objects only.

Share this post


Link to post
Share on other sites
oh, there should be QBE vars,

example : 'QBE.EQ.zfield=400015'

preset is for new objects only.

Wow, great thought! I hadn't considered that before.

Tried out the following and still isn't setting zfield with the value.

upd_specific_frame('sd','list_in.htmpl','QBE.EQ.zfield=400015')

upd_specific_frame('sd','search_in.htmpl','QBE.EQ.zfield=400015')

I have to step away from this for the day, hoping my subconscious will have a breakthrough.

Share this post


Link to post
Share on other sites

Maybe I didn't understood your problem, are you trying to search incidents where zfield is some value?

If yes, try this one:

ahdframe.upd_specific_frame('sd', 'SEARCH', 'FACTORY=cr', 'QBE.EQ.zfield=400015');

Share this post


Link to post
Share on other sites
Maybe I didn't understood your problem, are you trying to search incidents where zfield is some value?

If yes, try this one:

ahdframe.upd_specific_frame('sd', 'SEARCH', 'FACTORY=cr', 'QBE.EQ.zfield=400015');

So I was trying to get the Search menu item to default a search parm, and you've done it. You are awesome and excellent.

I used this in the function that I created when I inserted a new item via Menu Designer. I set a label and then published.

upd_specific_frame('sd', 'SEARCH', 'FACTORY=cr', 'QBE.EQ.zfield=400015')

Makes sense given the PRESET is for new objects only.

Thank you so much for your help.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...