- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
in ADF course (Application Development Fundamentals (Zurich)), lab 4.2.2, two rules are used to pass some data from server side to client side with g_scratchpad.
1. A "display" business rule, setting proerties to g_scratchpad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @MaxonLiang ,
If you’re seeing a g_scratchpad is not defined error, it usually means that no data has been passed to the g_scratchpad variable from the Display Business Rule.
This often occurs when the rule doesn’t include any logic to assign values to g_scratchpad.
Loaner request is custom table. from which table this custom table extends.
Asking because requested_for is OOB if field. If your custom table is not extending anything ,in that case requested_for should be a custom field like u_requested_for.
Validate field name from your table. Pass the same to your Display BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @MaxonLiang ,
If you’re seeing a g_scratchpad is not defined error, it usually means that no data has been passed to the g_scratchpad variable from the Display Business Rule.
This often occurs when the rule doesn’t include any logic to assign values to g_scratchpad.
Loaner request is custom table. from which table this custom table extends.
Asking because requested_for is OOB if field. If your custom table is not extending anything ,in that case requested_for should be a custom field like u_requested_for.
Validate field name from your table. Pass the same to your Display BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Despite requested_for is valid or not, as we can see, i make another field u_city in the BR that hard code to a string
g_scratchpad.u_city = 'city222';
however, in client script side, g_scratchpad.u_city is still undefined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
A new finding, once i comment out below two lines in BR
// g_scratchpad.city = current.requested_for.city;
// g_scratchpad.country = current.requested_for.country;
then
g_scratchpad.u_city can be access normally in client script side.
So, seems we can say, once any undefined field is added to?g_scratchpad, even any valid field added later do not work, as?g_scratchpad seem has been "destroied" by the?undefined field.
Next? I will further check why?current.requested_for.city is undefined, though I had set it on the request for user per the lab requirement in advance .
Thanks for your prompt!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Finally it's found that
current.requested_for
should be
current.request_for
the field name is incorrect in the lab course🤣
