2024 Nov 11 1:33 PM - edited 2024 Nov 11 1:46 PM
Hi,
I have a problem when trying to transfer binding from Action to Page.
When I click on object table row and afterwards navigate directly to a Page, all works fine, the fields on that page show the binding informations.
If i click on the same Object Table but i navigate on a Popup(choose an operation(buttons) that affects the target page) and from Popop to the Page, the Page does not receive the binding from the first action:
Object Table -> OnPress(NavToPopup) -> Press Button on Popup -> OnPress(Initialize and Fetch data) -> NavToShowSalesOrderPage
I tried to use rules in the OnPress event of Popup Buttons but I was unable to transfer the binding.
OnPress Event of Pupup Button(Initialize)
let pageProxy = clientAPI.getPageProxy(); clientAPI.showActivityIndicator(clientAPI.localizeText('Loading')); clientAPI.executeAction("/App/Actions/ClosePage.action"); pageProxy.setActionBinding(pageProxy.getBindingObject()); return clientAPI.executeAction("/App/Rules/CreateSalesOrder/FetchSalesOrder.js");
export default async function FetchSalesOrder(clientAPI) { let pageProxy = clientAPI.getPageProxy(); //get action binding var binding = pageProxy.getActionBinding(); //get client data let appClientData = pageProxy.getAppClientData();
....Fetch Operations...
clientAPI.dismissActivityIndicator(); return clientAPI.executeAction("/App/Actions/ShowSalesOrderActions/NavToShowSalesOrder.action"); }
How I can transfer the binding ?
Thank you.
Request clarification before answering.
i think i found the problem.
Inside FetchSalesOrder.js there is the following code for Fetch all the needed data:
//read items clientAPI.read(servicePath, entitySet, [], query).then((result) => {
appClientData.Items = []; for (let i = 0; i < result.length; i++) { let orderItem = result.getItem(i); appClientData.Items.push(orderItem); } //read texts entitySet = "TextSet"; return clientAPI.read(servicePath, entitySet, [], query); }).then((result) => { appClientData.HeaderTexts = []; appClientData.ItemTexts = []; for (let i = 0; i < result.length; i++) { let orderText = result.getItem(i); if (orderText.Posnr === "") { appClientData.HeaderTexts.push(orderText); } else { appClientData.ItemTexts.push(orderText); } } //read conditions entitySet = "ConditionSet"; return clientAPI.read(servicePath, entitySet, [], query); }).then((result) => { let orderCondition = []; for (let i = 0; i < result.length; i++) { orderCondition.push(result.getItem(i)); } appClientData.PricesCondition = orderCondition.reduce(function (r, a) { r[a.Pos] = r[a.Pos] || []; r[a.Pos].push(a); return r; }, Object.create(null)); }).then((result) => { clientAPI.dismissActivityIndicator(); return clientAPI.executeAction("/App/Actions/ShowSalesOrderActions/NavToShowSalesOrder.action"); }).catch((error) => { return Utility.displayErrorMessage(clientAPI.localizeText('DataReadError', [binding.OrderS])); });
If the clientAPI.executeAction for Navigation in inside the then( ) method of Promise the binding fail to transfer to the next page.
If I copy the executeAction outside like this:
//read items clientAPI.read(servicePath, entitySet, [], query).then((result) => { .......... }).catch((error) => { return Utility.displayErrorMessage(clientAPI.localizeText('DataReadError', [binding.OrderS])); }); clientAPI.dismissActivityIndicator(); return clientAPI.executeAction("/App/Actions/ShowSalesOrderActions/NavToShowSalesOrder.action");
The binding transfers correctly to the Next Page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
42 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.