I'm having issues with using ".exists" when trying to identify if a resource exists. In my code, we want to check to see if a resource exists, and if it does we want to turn on and off certain pages by using a global function called ActivatePage().
Whenever the resource does exist, the code works fine. Whenever the resource does not exist, it gives me an error on the CreateResource line and skips all of the if statements. Please help!!
This code is in the OnRecordStart rule:
Pic = CreateResource(Field("aao_1") + ".pdf","graphic");
aaotwo = Field("aao_2");
if (aaotwo != "")
activatePage(3,4);
else
if (Pic.exists)
activatePage(1,2);
else
activatePage(3,4);