Thursday, March 31, 2016

Remove HTML tags of Text in EP

I had to retrieve a text value stuck in HTML tags. It was the JobAdText field in HRMRecruitingJobAd table. This field has values like "<BODY>Some description</BODY>" and I had to get the value "Some description".

You can use the below code:

Literal jobAd = this.rightGroup.FindControl("html_JobAd") as Literal;
jobAd.Text = HtmlUtilities.CleanupUnsafeHtml((string)currentJobAdRecord.GetFieldValue("HRMRecruitingJobAd!jobAdText"));

You can take the reference from the standard web control "HcmEPOpenJobsListPagePreviewPart" where the same code is used.

Suggestions and feedback welcome :)

Navigation pane issue in EP

I faced an issue with a new web control (put on Employee Services) which was showing Navigation pane when viewed through Employee Services module but when user goes to some other page and come back the navigation pane was not visible.

The problem looked weird that why would a page do it when the "Module" property on the PageDef was set to Home\EmployeeService!

But in both the cases the URL opening was different. Below are both URLs:
Working:
http://server/sites/DynamicsAx/EmployeeServices/Enterprise%20Portal/Ale_HcmOpenJobs.aspx?WMI=Ale_HcmOpenJobs&WebModuleName=Home%5cEmployeeServices%5cOrganization&WCMP=GCO&WDPK=initial

Non-Working:
http://server/sites/DynamicsAx/EmployeeServices/Enterprise%20Portal/Ale_HcmOpenJobs.aspx?WMI=Ale_HcmOpenJobs&WCMP=GCO&WDPK=initial

So I found a solution which I must say can be a workaround with no other impact.

Just go and set the "ShowParentModule" property to "No" on the node of the WebMenu where the control is added and it will work.

Tuesday, March 22, 2016

Repeat table header SSRS

Sounds easy going by the usual way of Tablix properties and check the "Repeat header rows on each page". Strangely this didn't work for me today so I found out a new way for same.

Under Design Pane - > at the bottom Column Groups - > click on drop down (down arrow) - > Advanced Mode.



Once we selected Advanced Mode, we will be able to notice (static) in Row Groups and Column Groups at the bottom of Design pane .



Under Design Pane - > Row Groups - > click on (static) - > Press F4 - > Properties window will pop-up.

In the Properties window - >Set KeepWithGroup = After and RepeatOnNewPage = True.

If you want the header to be frozen while scrolling down the report, set FixedData = True.




Credit: http://social.technet.microsoft.com/wiki/contents/articles/19398.ssrs-how-to-repeat-headers-on-each-page.aspx

Tuesday, March 8, 2016

Disable/Hide Modules from Ax2012

Today I found an interesting way to disable modules from AX for all users. One of our clients had asked us to do so for them. There are ways which we all are aware of like disabling configuration keys, disable licenses or maybe through code.

I had simply put a different country code (other than the base country) to the modules need to be hidden. When we do this those modules will only be available to that specific country whose code is attached. So this worked perfectly in our case. :)

Sunday, March 6, 2016

AxForm insert not working

Strange is the word when it comes to EP. Today I faced an issue where there is a web control with an AxForm with 2 buttons "OK" and "Cancel" but info is not getting inserted into the table on "OK" button click. The biggest confusion was that this web control was working in Dev environment but not in UAT. So I imported the object from Dev to UAT but to no help.

Then started observing the DataSet's properties and found a property called "InsertIfEmpty", by default it was "Yes". So I changed it to "No" and it worked.

Now the question was "why it worked in Dev not in UAT?". Dev already had some records in the table and UAT was newly created DB.