cancel
Showing results for 
Search instead for 
Did you mean: 

Results not displayed in the Object Table with String Target

harianantha
Participant
0 Kudos

Hi,

I am using string target for Object Table like below. In the rule, I am returning the array. But data is not displayed on the page. And when I do click on search and start typing it I can see the data on the page. I want data to be loaded without the interaction of search. Any Solution? ---- Thanks in advance !!

"Target": "/Project/Rules/OnLoadData.js"



Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can you share your rule?

harianantha
Participant
0 Kudos

Hi bill.froelich,

I tried returning the hardcoded array like below. It's working.

export default function OnLoadData(clientAPI) {
return [{
"Description": "Test Lead 11",
"Notes": "Lead Generation from Marketing Planning",
"StartDate": "25/12/2014",
"EndDate": "24/12/2016",
"UserStatusText": "lost"
}, {
"Description": "Test Lead 21",
"Notes": "Lead Generation from Campaign Planning",
"StartDate": "25/12/2014",
"EndDate": "24/12/2016",
"UserStatusText": "won"
}];
}

But when I do like below it's not working in mobile whereas data is coming in web app(oBinding.leadsList has same array like above mentioned when I did debug).
export default function OnLoadData(clientAPI) {
var sCurrentPage = clientAPI.getPageProxy().currentPage;
var oBinding = sCurrentPage.previousPage.context.binding;
return oBinding.leadsList;
}

Looking forward to hearing from you. Thank you!!
bill_froelich
Product and Topic Expert
Product and Topic Expert

I don't believe that you can reference the source from the previous page that way in the mobile client. I tried a number of combinations but was unable to access the binding from the previous page. My suggestion would be to store the binding in ClientData on the previous page so that it can be easily accessed from the next page.

Did you test your rule in the VS Code debugger to confirm your oBinding.leadsList contains data?

harianantha
Participant
0 Kudos

I am using BAS for the development, not VS code. I have debugged in the web app.
Okay. Let me try with ClientData. Thanks for your response !!

harianantha
Participant
0 Kudos

It's worked with Client Data.

I think problem with this line 'clientAPI.getPageProxy().currentPage' in mobile. Probably It's not returning anything.

Thanks Bill

Answers (0)