Resco JavaScript Bridge: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 870: Line 870:
# Edit an [[app projects|app project]] in [[Woodford]].
# Edit an [[app projects|app project]] in [[Woodford]].
# On the '''Project''' menu, select '''Account''', then click '''Show UI'''.
# On the '''Project''' menu, select '''Account''', then click '''Show UI'''.
# Click '''New View''' and create an empty view:<br>[[File:New iframe view.png|600px]]
# Click '''New View''' and create an empty view:<br>[[File:New iframe view.png|alt=Create a view with iframe for EntityList in Woodford: New iframe view|600px]]
# Click '''iFrame''' and add an HTML file to the view:<br>[[File:Add iframe to view.png]]
# Click '''iFrame''' and add an HTML file to the view:<br>[[File:Add iframe to view.png|alt=Create a view with iframe for EntityList in Woodford: Add iframe to view]]


What does the parameter '''Provides data source''' mean?
What does the parameter '''Provides data source''' mean?
Line 1,085: Line 1,085:
Woodford setup: Make sure to set '''Kind''' to '''Text-Edit''' to make it editable.
Woodford setup: Make sure to set '''Kind''' to '''Text-Edit''' to make it editable.


[[File:View with fax validation.png|600px]]
[[File:View with fax validation.png|alt=Resco JavaScript Bridge: Event handlers on entity list: View with fax validation|600px]]


Now we must register the '''onChange''' event handler to allow us to control what value the user writes to the fax field. In our case, we just check if the value is not empty. If yes, we explicitly set a default value.
Now we must register the '''onChange''' event handler to allow us to control what value the user writes to the fax field. In our case, we just check if the value is not empty. If yes, we explicitly set a default value.
Line 1,159: Line 1,159:
:For this event I will start with a scenario that suits this event the most.
:For this event I will start with a scenario that suits this event the most.
:Sample scenario: Since this event is triggering in various situations, most of time we want to handle it from the application start. In this special case, we have to register this event during an application opening. The question is: How to bind iframe with a handler to the homeForm? Answer: We have only one option, to place the HTML file to the first position of home items. If this happens, the application replaces the native UI with your custom HTML.
:Sample scenario: Since this event is triggering in various situations, most of time we want to handle it from the application start. In this special case, we have to register this event during an application opening. The question is: How to bind iframe with a handler to the homeForm? Answer: We have only one option, to place the HTML file to the first position of home items. If this happens, the application replaces the native UI with your custom HTML.
:[[File:Ui replacement.png]]
:[[File:Ui replacement.png|alt=Resco JavaScript Bridge: SyncStarted: UI replacement]]


{{Note|You have to name this iframe only as UIReplacement or HomeReplacement. Other names of iframes and their content including the script part are ignored until you directly open them.}}
{{Note|You have to name this iframe only as UIReplacement or HomeReplacement. Other names of iframes and their content including the script part are ignored until you directly open them.}}
Line 1,241: Line 1,241:
# Edit an [[app projects|app project]] in [[Woodford]].
# Edit an [[app projects|app project]] in [[Woodford]].
# Select '''Entities > Account''' from the '''Project''' menu and click '''Show UI'''.
# Select '''Entities > Account''' from the '''Project''' menu and click '''Show UI'''.
# Click '''New View''' and enter the following parameters, then click '''OK'''.<br>[[File:Create a new lookup view.png]]
# Click '''New View''' and enter the following parameters, then click '''OK'''.<br>[[File:Create a new lookup view.png|alt=Resco JavaScript Bridge: Create lookup view in Woodford]]


=== Independent lookup ===
=== Independent lookup ===
Line 1,253: Line 1,253:
Another important thing to know is how to define views available for selection in the app.
Another important thing to know is how to define views available for selection in the app.


[[File:View selector in the app.png|150px]]
[[File:View selector in the app.png|alt=Resco JavaScript Bridge: Independent lookup: View selector in the app|150px]]


For this, we can use addView method. Each view that we add using this method will be available in the selector.
For this, we can use addView method. Each view that we add using this method will be available in the selector.
Line 1,265: Line 1,265:
The code from reference page: https://www.resco.net/javascript-bridge-reference/#MobileCRM_UI_LookupForm_show
The code from reference page: https://www.resco.net/javascript-bridge-reference/#MobileCRM_UI_LookupForm_show


[[File:JSBridge Guide 031.png|600px]]
[[File:JSBridge Guide 031.png|alt=Resco JavaScript Bridge: Normal LookUp form|600px]]


==== MultiLookUp form ====
==== MultiLookUp form ====
Line 1,292: Line 1,292:
The code from reference page: https://www.resco.net/javascript-bridge-reference/#MobileCRM_UI_MultiLookupForm
The code from reference page: https://www.resco.net/javascript-bridge-reference/#MobileCRM_UI_MultiLookupForm


[[File:JSBridge Guide 032.png|600px]]
[[File:JSBridge Guide 032.png|alt=Resco JavaScript Bridge: Custom M:N relationship MultiLookup form|600px]]


For example, the mentioned LookUp can be executed by using the button command in your HTML files.
For example, the mentioned LookUp can be executed by using the button command in your HTML files.
Line 1,410: Line 1,410:
If we get the group, we can set the property of this object. In our case, we disable the whole group. You can set the visibility of the group as well. We can set these properties also on the question if it's available. We changed the description. In the application, it looks like this.
If we get the group, we can set the property of this object. In our case, we disable the whole group. You can set the visibility of the group as well. We can set these properties also on the question if it's available. We changed the description. In the application, it looks like this.


[[File:JSBridge Guide 040.png|600px]]
[[File:JSBridge Guide 040.png|alt=Resco JavaScript Bridge: Access questionnaire data, set properties|600px]]


==== Work with handlers ====
==== Work with handlers ====
Line 1,441: Line 1,441:
The error message is displayed when a user attempts to close the form.
The error message is displayed when a user attempts to close the form.


[[File:JSBridge Guide 041.png|600px]]
[[File:JSBridge Guide 041.png|alt=Resco JavaScript Bridge: Work with handlers|600px]]


==== OnSave event ====
==== OnSave event ====
1,214

edits

Navigation menu