Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:46:30+00:00 2026-06-15T19:46:30+00:00

I am calling entityLoad like this: currentSubmission = entityload(EventSubmission, { eventID = variables.eventID, profileID

  • 0

I am calling entityLoad like this:

currentSubmission =  entityload("EventSubmission", { eventID = variables.eventID, profileID = variables.profileID, true }

How do I check if the entityLoad has returned a record or not? If there is a match on the filtercriteria, an Object is returned. If there is no match, nothing is returned and the variable currentSubmission doesn’t exist.

The problem I am finding is that if I use:

a. isObject(currentSubmission), gives an error when nothing is returned, as currentSubmission doesn’t exist.

b. isDefined(currentSubmission), gives an error when something is returned as you can’t perform isDefined on an object.

So the quesiton is, what method should I use to determine whether or not entityLoad returned a result or not?

Here is the full method I am trying to put together. Basically, I want to load an entity based on some filter criteria and return it, if there is no matching entity, then return a new Empty entity.

public function getByEventProfile(){
    currentSubmission =  entityload("EventSubmission", { eventID = variables.eventID, profileID = variables.profileID }, true);
    if (!isObject(currentSubmission))
        currentSubmission = entityNew("EventSubmission");
    return currentSubmission;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:46:31+00:00Added an answer on June 15, 2026 at 7:46 pm

    Try isDefined("currentSubmission") (note the quotes) or slightly faster structKeyExists(variables,"currentSubmission")

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Calling getActionBar returns null . This has been frequently reported so I've made sure
Calling all cross-compatibility experts! Please check out this page on my site, as it
Calling the WriteObject Method from a background thread is not possible! Is there a
Calling Index view is giving me this very very annoying error . Can anybody
Calling all AutoMapper gurus! I'd like to be able to map object A to
Calling setFocus(null) on the ItemizedOverlay does not 'unfocus' current marker. According to the documentation:
Calling the UDF like so: SELECT product_name, SUM(quantity) AS SumQty, SUM(face_value) AS SumFaceValue, SUM(net_cost)AS
Calling index.php?pConta=1&pDataInicial=01-01-2000&pDataFinal=31-12-2000 I get this notices: [08-Oct-2009 17:30:35] PHP Notice: Undefined index: pConta in
calling .center() makes the panel center on the entire page.. I'd like to have
Calling all the PHP helpers out there. So basically I would like to give

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.