Sign In   Register
  Wednesday, 01 September 2021
  1 Replies
  165 Visits
0
Votes
Undo
  Subscribe
I am trying to use DynamicData.call() in my Form. There is an existing working Service deployed in Transact Manager (Test mode enabled). I added a Dynamic Data Button in the Form to experiment to see if I can retrieve data from the Service.

I am running the Form in preview and I keep getting the error message "Cannot invoke DynamicData.call() in preview without adding preview data" when the call is invoked. The error is thrown from the Promise. I realise that the error message is internal as the call did not make it out to the online Service because the same error appears even when I gave it a rubbish Service name.

The DynamicData.call() works without issue If I deploy the Form to Transact Manager.

Any help is appreciated.
2 months ago
·
#14231
Accepted Answer
0
Votes
Undo
Hi Alan Lee ,
When developing a Maestro form, you cannot call services for several reasons. The first reason is that it is likely that your form is located on one of the shared Maestro instances which will not have the service available. On the shared instances we do not install services as this should be done on your organisations Journey Manager instances. The second reason is that even if it was available on the same environment, previewing the form generates the form and injects it into an iFrame and only is running in your browser, it is not part of a transaction so Journey Manager would not acknowledge the service call it would not have a valid request key that Journey Manager requires to handle a dynamic service call.

If you refer to the API documentation for Form.addPreviewDDSData(serviceName, dataOrHandler) you can add script to your code that does something like:

if (Resource.preview) {
Form.addPreviewDDSData("myService", {name: "Glenn", team: "Journey Maestro"})
}

or something like:

if (Resource.preview) {
Form.addPreviewDDSData("myOtherService", function(params) {
if (params.name) {
return {message: "Hello "+params.name }
} else {
return {message: "Hello unnamed person"}
}
});
}

This way you can test your function calls while providing stub data as publishing the form and pushing it to your Journey Manager instance and then testing your form does have a longer round trip than using preview.
Chris Eagar selected the reply #14231 as the answer for this post — 2 months ago
2 months ago
·
#14231
Accepted Answer
0
Votes
Undo
Hi Alan Lee ,
When developing a Maestro form, you cannot call services for several reasons. The first reason is that it is likely that your form is located on one of the shared Maestro instances which will not have the service available. On the shared instances we do not install services as this should be done on your organisations Journey Manager instances. The second reason is that even if it was available on the same environment, previewing the form generates the form and injects it into an iFrame and only is running in your browser, it is not part of a transaction so Journey Manager would not acknowledge the service call it would not have a valid request key that Journey Manager requires to handle a dynamic service call.

If you refer to the API documentation for Form.addPreviewDDSData(serviceName, dataOrHandler) you can add script to your code that does something like:

if (Resource.preview) {
Form.addPreviewDDSData("myService", {name: "Glenn", team: "Journey Maestro"})
}

or something like:

if (Resource.preview) {
Form.addPreviewDDSData("myOtherService", function(params) {
if (params.name) {
return {message: "Hello "+params.name }
} else {
return {message: "Hello unnamed person"}
}
});
}

This way you can test your function calls while providing stub data as publishing the form and pushing it to your Journey Manager instance and then testing your form does have a longer round trip than using preview.
There are no replies made for this post yet.
Be one of the first to reply to this post!

Q&A Forum - Tips

The purpose of the Temenos Journey Manager platform (TJM) Q&A forum is for all clients and partners to seek help...

Read More

Not a member?

Register to ask a question and access to more content.

Join now

Looking for something else?

You can request access to:

  • Courses
  • Full Release Notes
  • Product Downloads
  • SDK

Request access

Leader Board

1
Mark Murray
User's Points: 1360
2
Lin Vanoevelen
User's Points: 1046
3
Julio Berrueco Pinto
User's Points: 715
4
Matthew White
User's Points: 386
5
Chad Thomas
User's Points: 300