microsoft dynamics nav 2009, show/hide control - microsoft-dynamics

I have a control on a form that I want to hide.
But if I do the following action:
LocFrmQuoteInfo.Control1000000002.VISIBLE(false);
I get the error:
Unknow variable: Control1000000002
but Control1000000002 is the name of the control.
Thank you
But I have a form 50007 and I want to have access controls on a other form. But On Form 50007 I dont have access on the controls of the other form. So I mad a function on the other form, like this:
IF Option = 1 THEN
CurrForm.hallo.VISIBLE(TRUE);
CurrForm.FromOrder.VISIBLE(FALSE);
IF Option = 2 THEN
CurrForm.hallo.VISIBLE(FALSE);
CurrForm.FromOrder.VISIBLE(TRUE);
And then in form 50007 I do this:
LocFrmQuoteInfo.FnOrderOfferte();
But how to get access to option 1 or option 2 in form 50007?
Thank you

The quick solution to your question is that you need to set a non-default name for the property (Shift+F4) so it shows up in the C/AL Symbols Menu (F5) which will then allow you to reference it and assign values to it in the application.
I have not found where that is referenced, but I would assume it is there to prevent the symbols menu from having every control listed on it in some of the very large reports, forms and other objects.
This would allow you to write something like
CurrForm.TextboxToHide.VISIBLE(FALSE);
You can also set this directly on the property of the object if it will be hidden for all users, which does not require changing the default name of the control.

Related

Calling a non-modal dialog page passing IR report ID in page url

I am trying to change all popup pages in an app from normal page template to non-modal-dialog page template in apex 5.1
I'll try to describe the complete use-case:
I have an Interactive report page with link columns for each record which opens a dialog window where users can edit/interact with the record.
The dialog has Previous/Next buttons to allow users to navigate through the records.
When a filter is set on the report, the dialog window should take this into account in the Next/Previous behavior.
For e.g. if the report filter selects only one row, then the dialog window Next/Previous buttons are disabled because there are no more rows shown by the report to navigate through.
For this functionalities, I need to pass the IR-report ID to the non-modal page.
Now the href property of the link column in the IR report should be something like:
javascript:apex.navigation.dialog('f?p=123:40:12345678:::40:P40_SIGNAL_DEF_ID,P40_IR_REPORT_ID,P40_MODE:42,41982451655076402,E&p_dialog_cs=NwEcqexhNPGD1VziCXol65xHCP8',{title:'SIGNALS_DIGITAL',height:'auto',width:'720',maxWidth:'960',modal:false,dialog:null},'t-Dialog-page--standard '+'',apex.jQuery('#myStaticID'));
Only two parts in this link I am concerned about. One is the checksum part (p_dialog_cs=NwEcqexhNPGD1VziCXol65xHCP8) and other part is the IR report ID(41982451655076402) I used apex_util.prepare_url function in the SQL query but this is not returning IR report ID something like :
javascript:apex.navigation.dialog('f?p=123:40:12345678:::40:P40_SIGNAL_DEF_ID,P40_IR_REPORT_ID,P40_MODE:42,,E&p_dialog_cs=NwEcqexhNPGD1VziCXol65xHCP8',{title:'SIGNALS_DIGITAL',height:'auto',width:'720',maxWidth:'960',modal:false,dialog:null},'t-Dialog-page--standard '+'',apex.jQuery('#myStaticID'));
I am not able to get the IR report ID here I tried using $v("myStaticID_report_id") inside this query but not working(though it is working in console)
So right now I am calling apex_util.prepare_url with dummy string say 'report_ID' the result I am passing to a javascript function as an argument. In javascript function, I am extracting the url part of the string(because I need the checksum value) and then replacing the dummy variable with $v("myStaticID_report_id") and then calling apex.navigation.dialog from there.
Now its functional but this needs to be repeated in almost 70 pages in my application. So I want to know if there is a better way to do this.
Thanks in advance

Can I dynamically disable a drilldown in Siebel 7.8?

I have a list applet with a drilldown in one of the columns, and I want to enable or disable it based on another field's value. Something like a dynamic drilldown, but instead of choosing a different view, I want to disable the navigation for some of the records.
Can this be done in Siebel 7.8?
Ideally without server scripting... and definitely without ugly browser scripting hacks, please.
I have tried creating a dynamic drilldown, but it doesn't work because I have to specify a target view in my parent default drilldown. If I use an inactive view for that, then the whole dynamic drilldown is ignored and Siebel simply uses the one with the next sequence number.
I can think of a couple of ways to implement it, but both are far from ideal:
Writing some server script to detect the drilldown event before it happens, and abort it if needed with a RaiseErrorText message. It should be doable... but I'd rather disable the drilldown than throw an ugly error to my users.
Placing the drilldown in a calculated field, and make it have no text when there should be no navigation. If there is no text, there is nothing the users can click to drilldown, right? But I would have to add a new column just for the drilldown, which would be confusing for the users.
If you don't want any scripting. There are 2 ways.
First way is using toggle applet.
1.Main Applet will have the drill down down object. And Toggle applet will not have the drill down objects.
2.Create a field in the BC to use it in the Toggle Applet condition .Toggle Applet will be displayed when the drilldown is not required.
Second way you can achieve it is through visibility Type attribute in the drilldown object as well as visibility Applet Type attribue at the view level.

Sitecore Conditional Showing of Fields

So I am rather new to sitecore, and it's a topic that wasn't covered during my training. My questions is just to help point me to the correct term, or documentation on a method to do the following.
I have a definition item, with a ton of field groups, what I want to do is something like:
if Value of Field X is "yes" then collapse/hide Field X or Field Group X.
Does that make sense? Is it a validation rule? or some other kind of rules, is it a workflow I need to attach? Do you place it on just the field I want to hide, or the field that triggers the action?
I appreciate any guidance.
There is nothing out-of-the-box in Sitecore to achieve what you want but there is no reason you cannot create a composite custom field type to do this. The following articles will help you achieve this:
Creating a custom Sitecore Field
Getting to Know Sitecore: Custom Fields, Part 1
Create a new control, inheriting either from Droplist (if the comparison of the value is to be text based) or Droplink (for comparison of ID). You could add a parameter in the Source field of the control to specify what the values that trigger the hide should be.
The underlying control in the Content Editor is just a standard HTML select element. Add onchange events to the control and add your Javascript handler to hide the other controls. Since I could not find a way of adding additional custom css classes to the Sitecore controls, it would be best/easiest to hide all other controls in the same collapsible group after you control. This would mean you would need to group your controls better (or logically at least).
The Javascript will be something like this (the Content Editor uses the Prototype JS framework):
if ($(this).getValue() == 'no') {
// find the parent container of this control and then hide all the next siblings in the same group
$(this).up('.scEditorFieldMarker').nextSiblings('.scEditorFieldMarker').invoke('hide');
}
You can test this by running the above in the console, change out the keyword this with the id of your field, e.g. $('FIELD2292054').
What I am not sure about is how to trigger the hide on initial load, i.e. when someone returns to an existing item, it may be possible by adding to one of the pipelines, but would be better using a JS solution if possible. I'll have a think about this and get a proper code sample up over the next few days.
EDIT: You can add an event handler to sc:contenteditorupdated to handle the content editor being rel-oaded.
document.observe("sc:contenteditorupdated", myFunction);
I wrote up a blog post and put the code on GitHub if you are interested.
Not sure if you have come across Andy Uzick's this blog post.
He wisely talks about hiding fields in the Content Editor and has also created a Sitecore Module called Hide Field Template Extension which is hosted on the Sitecore Marketplace with the full source code to extend.
After reading through and trying the extension, I do feel that it will not completely resolve your issue (how you have described it in the question).
But it will give you:
A mid-term solution to hide a few unnecessary field that some content editors would not like to view.
Fields that are only required by administrators for admin purpose - to de-clutter these fields could be hidden.
Just one thing to bear in mind that it mentions in the requirements Sitecore 6.5 & 6.6. I have not tested it in Sitecore 7. If you are using Sitecore 7, which I think you are, one could modify the source code and make it work for Sitecore 7.
Have a look and share your findings.
Happy Sitecoring!

Django - Dynamically assign initial value to form from other fields

I'm creating a Django app. I would like to know it it's possible (I haven't seen anywhere that it is) to create a form which has initial values that can change depending on selections in other fields. To be more specific, I have a field which is a drop-down menu of standard cosmologies, each of which has a certain set of parameters. These parameters are fields of their own. I want to set the initial values of these parameters after the user has selected a specific option from the drop-down menu. If possible, they should also be greyed out (ie. not changeable) when this is done (there is one option in the dropdown which is 'Custom', for which they should be editable).
I hope that's enough information. Cheers.

Selecting a datasource item for preset components

Before digging into my explanation i will summarize my question:
How do I provide the user (editor) with a user-friendly possibility to select a datasource item for sublayouts that are preset on the standard values?
My situation is as follows:
I have a page template, with pre-defined layout on the standard values.
Let's say the layout consists of:
one placeholder "wrapper"
one sublayout "content"
This sublayout is pre-defined on my page template, but can also be placed in the placeholder using the Page Editor.
It needs to have a datasource item that defines a Title and Body value.
Now, if a user adds this sublayout to the placeholder using the Page Editor, he will get a nice interface to select or create the datasource item (see screenshot).
However, if the sublayout was pre-defined on the standard values, it will be added without datasource (I can't pre-set the data source in the standard values because it's still unknown by then).
At that point there seems to be no way to get to that nice interface for selecting or creating a datasource item.
Ideally I want to be able to add a field to my template that can hold a datasource item which the user can select/create using the nice interface. I looked at the datasource field type, which could be an alternative, but it's still not exactly what I want.
Bare in mind that the content sublayout is just an example.
I understand that in that specific case I could solve it by always adding a title/body field to the template which hold the values if there is no datasource, but for my real world problem that won't suffice.
I don't have a whole lot of experience with the Page Editor (with the new way of working with it) so I would like to get some advice on this subject.
According to what you said here:
Ideally I want to be able to add a field to my template that can hold a datasource item which the user can select/create using the nice interface. I looked at the datasource field type, which could be an alternative, but it's still not exactly what I want.
It seems you want an intuitive data source selector interface in the CMS shell similar to the Page Editor-based UI.
Quick answer: Simply put, there's nothing that does this for you in Sitecore.
Longer answer: There are still some options for you, e.g.
Define a global "dummy" data source and set that to be the data source set in in Presentation > Layout Details of the template's standard values. So every time you create a new page, it will always point to that dummy value to show something.
From here you can do a few things:
If the user must use the shell UI and not Page Editor, they can simply create another data source item for the specific page and update that page to point to it using the existing native interface in Layout Details.
Another option is to write an event handler, say for item:created or similar that when you create an item, auto-create a corresponding data source item for this specific page (whether this auto-created item be a sub-items or global item...) then programmatically set this to be the data source. A similar concept is shown in this video by Nick Wesselman: http://www.techphoria414.com/Blog/2012/May/Sitecore_Page_Editor_Unleashed