cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Debugging Script defined under a event on the UI Designer

Former Member
0 Likes
870

HI,

small (noob) question: Is there any way to debug an scrip defined under a event on the UI designer?

I dont see any way to set a breakpoint in this kind of scripts, even when I start "Debuggin mode" on the studio.

kind regards,

Andres

View Entire Topic
HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Andres,

Sorry, there is no debugger for Frontend Scripting.

Bye,

   Horst

Former Member
0 Likes

Horst thanks for you feedback.

I have a small question: it's possible to have the access on the backend (SDK studio) to attribute defined on the UI frontend datamodel?

In case YES:

Due the fact that my script is responsible for filtering the content of a AdvanceListPanel, I was wondering if the following approach would work:

  • Create a script file on the involved Business Object
  • Define the filtering logic on the script event
  • On the UI eventhandler (
  • FrontEnd) replace the script setp by a BOAction and call the script defined on the Business Object.

In case my approach works, I will be able to debug my script coding.

In case NO:

I want to be able to debug the following peace of code due the fact I doesnt work as expect and I dont see any issue on my coding.

  • $data.SearchDoc

         Thi is an input field defined on the FrontEnd.

  • $data.Opportunity.Get(i).AttachmentFolder.DocumentList.Get(j).AlternativeName

        This is an opportunity found by means of a FrontEnd Query.

Do you maybe see any reason why even when AlternativeName = "Hello There" and SearchDoc = "Hello", the StringUtils.Contains return False?

He the fully peaco of coding:

Many thanks in advance for all the tips and help you can provide me.

kind regards,

Andres

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Andres,

In the backend you are on BO level. That's much "deeper" than the UI level.

So, a BO does not know which UIs for itself are existing neither details about any of those UI models.

In short: NO.

For your Frontend Scripting:

Did you test it with a simple (maybe fixed values) example?
So you can determine if the
  • Get statement
  • AttachmentFolde.DocumentList association
  • AlternativeName data operation

are working at all.

HTH,

    Horst

Former Member
0 Likes

Horst,

Thanks for the explanation between the BO and UI level.

taking into account your tip; i performed some testing and I found my problem.

However i dont see the reason why i'm facing this issue. I was wondering if you could look into the following scenario and tell me if you see my problem/bug.

I created an input field on the UI. My goal is to allow the user to filter an advanceListPanel by means of this inputField. please find the definition and configuration in the following screenshot.

Now on my controllor, I defined an event which triggers a query to retrieve opportunities based on the current account displayed on the screen. After the query is performed, I placed an script which should perform the following actions:

  1. Filter opportunities which contain at least 1 attachment (document)
  2. Is there any value entered on the "Filter" input field
    • NO ==> Display all opportunities which contain at least 1 attachment (document)
    • YES ==> Filter collection found on step 1: Document name contains filter value.

My problem is that i dont find a way to correctly get access to the information entered input field.

The previuos IF-statement always fails even when I enter exactly the same string on the UI.

do you maybe see what i'm doing wrong?

kind regards,

Andres

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Andres,

Below the "Source" editor is the "Scope Fields" section.

Did you ensured to mark the "SearchDoc" field and have it added to the right hand section?

HTH,

    Horst

Former Member
0 Likes

Hi Horst,

Normally I did add the field to the scope, but i just checked and it was gone.

As you suggested, I performed some dummy testing to try to discover my issue (due the fact that it's not possible to debug). I encounter the following issue which i don't understand:

When I tried the following statements, it works as expected

var myFilterValue       = $data.SearchDoc.content

var currentDocName = $data.Opportunity.Get(i).AttachmentFolder.DocumentList.Get(j).AlternativeName

if($controller.StringUtils.Contains(myFilterValue      , 'GooGle'))  ==> OK

if($controller.StringUtils.Contains(currentDocName, 'GooGle'))  ==> OK

But when i try the following statement, it's always false (FYI: MyFilterValue = 'GooGle'):

if($controller.StringUtils.Contains(currentDocName, myFilterValue))  ==> OK


do you have any idea what its wrong?


kind regards,


Andres

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Andres,

So you mean if you hard-code the value the contains function finds the value, but if it's in a variable (and you checked the variable? How?)  it does not?

Bye,

   Horst