Need help with lab 4.2b of the ADF course

toddthigpen
Giga Contributor

For the Application Development Fundamentals On Demand Course, I created the "Set Scratchpad Values" business rule as shown below in the course documentation for the Module 4 lab 4.2b on Scripting, but the rule isn't working properly.

 

toddthigpen_0-1755631091615.png

 

 

I added the following code to troubleshoot and received the error shown below.

 

toddthigpen_1-1755631091619.png

 

 

toddthigpen_2-1755631091621.png

 

 

I tried to debug by setting a breakpoint at line 4 and executing using the Loaner Request record shown above.  The Script Debugger first indicated the "requested for" for the Current1 Local instance wasn't found but then showed as follows.

 

toddthigpen_3-1755631091622.png

 

 

Can someone advise why this is and how to resolve?

 

Could this issue be due to timing?

 

Thank you.

2 ACCEPTED SOLUTIONS

Bhuvan
Kilo Patron

@toddthigpen 

 

Did you get a chance to review this ?

 

If this helped to answer your query, please accept the solution and close the thread.

 

Thanks,

Bhuvan

View solution in original post

Hmmmm that's really strange... @toddthigpen can you please verify it is in the desired scope, if it wasn't required to perform it with an impersonated user and alternatively, try to delete the business rule and re-create it again from scratch?

 

The labs sometimes get stuck in point of no return and it might be easier to step back and start again... just the last step, not completely from the beginning.. 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


View solution in original post

10 REPLIES 10

GlideFather
Tera Patron

Hi @toddthigpen,

 

just hit or miss... have you really deleted the original value in the BR and replaced it by typing SetScratchpadValue and pressing tab?

 

Also, the requirement has less lines, you have the try/catch try/catch, and for the lab verification it usually must be 1:1, even a single blank space is considered mismatch.

 

 And as the error message says "TypeError" - is your BR of Display type? Can you please review and eventually share the BR with us?

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Hi @GlideFather .

 

Yes, I did delete the original value and entered the content using the SetScratchpadValues macro as stated in the lab instructions.   After testing per the lab instructions, I saw that the 'Location to be used' field in the Loaner Request form wasn't populated as per the 'Requested for' user selected. I added the try/catch statements to verify the City and Country fields were being passed to the 'Set Loaner Request' client script.  It appears that they are not.

 

To verify again, I just removed my code and entered it again using the macro.  I also verified that this Business Rule is configured to execute when display.

 

toddthigpen_0-1755650258110.png

 

 

toddthigpen_1-1755650258113.png

 

 

As shown below, the 'City' and 'Country' fields are populated for the user but the '' field isn't populated in the Loaner Request record.

 

toddthigpen_2-1755650258126.png

 

 

Please advise.

 

Thanks.

Hmmmm that's really strange... @toddthigpen can you please verify it is in the desired scope, if it wasn't required to perform it with an impersonated user and alternatively, try to delete the business rule and re-create it again from scratch?

 

The labs sometimes get stuck in point of no return and it might be easier to step back and start again... just the last step, not completely from the beginning.. 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Thank @GlideFather.  I had to redo all of the labs because my lab instance expired, and now the "Location to be used" field is populated correctly using the scratch pad.

I was hoping to understand why it didn't work before so I don't have the same issue in the future.  It may have had something to do with the Scope.