Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Check whether recid is empty or not

(0) ShareShare
ReportReport
Posted on by 70

How to check whether the recid of a table record is empty or not

if ( ! tablename.RecId )

{

........

}

Does this works ?

Thanks

  • Verified answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Check whether recid is empty or not

    Please Verify answers/s that helped you.

  • C4u Profile Picture
    C4u 70 on at
    RE: Check whether recid is empty or not

    Thanks everyone. It worked !

    Regards,

    C4u

  • Verified answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: Check whether recid is empty or not

    Hi C4u,

    You should have got the answer from the forum, and you can verify the answer to close the thread. 

    34425.png

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    RE: Check whether recid is empty or not

    As we know that recid is a big int type so we can simple give as

    If (tableName.RecId == 0)

    {

         //As per your requirement if empty

    }

    else

    {

         //Recid not empty.

    }

    You can also simply write like,

    If (!table name.RecId) for your requirement. Both the ways gives the correct answer.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,031 Super User 2025 Season 1 on at
    RE: Check whether recid is empty or not

    Hi C4u,

    If you want to evaluate if the record ID is not filled, then you can check for "tablename.RecId != 0"

  • Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    RE: Check whether recid is empty or not

    Okay, then show us the output.

  • C4u Profile Picture
    C4u 70 on at
    RE: Check whether recid is empty or not

    That didnt work as I expected, it behaved differently

  • Suggested answer
    Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    RE: Check whether recid is empty or not
    [quote user="C4u"]just want to check for it doesnt exist ?[/quote]

    This should work. Did you test it and it did not?

  • C4u Profile Picture
    C4u 70 on at
    RE: Check whether recid is empty or not

    just want to check for it doesnt exist ?

  • Suggested answer
    Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    RE: Check whether recid is empty or not

    if (tablename.RecId) // If record exist
    {
        // You might want to update
    }
    else // If it does not exist
    {
        // You might want to insert.
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans