How can I hide a nodereference url link for users who have already created a node I am working on a job listing site and wants users to be able to apply for jobs on the site.
I created 2 content types "Job posting" and "Job Application".

I used the nodereference_url module to add an apply now link on the job posting node that directs the user to the "job Application" form.
This works fine but i would like to make each user to be able to apply for a particular job only once.

Is there a way i can achieve this with my current setup? Is there a different way to go about this that will give me the desired result?

Thank you for the help
One solution that comes to mind includes using the nodereference_url_create_link function that is included in the Node Reference URL Widget module. From the documentation of the specific function:

/**
 * Helper function for themers to easily create a link.
 *
 * This function should be used in custom themes, rather than making manual
 * links because it first checks a user's access before showing the link. If
 * the user does not have access to create the node then an empty string will
 * be returned.
 *
 * @param $node
 *   The node object that will be referenced.
 * @param $field_name
 *   The name of the Node Reference field.
 * @param $type_name
 *   The name of node type that contains the Node Reference field.
 * @param $attributes
 *   Optional. An array of additional attributes to add to the link.
 */


You can use this in the node.tpl.php file for the Job Posting content type (which should be along the lines of node--job_posting.tpl.php if you're in D7 or node-job_posting.tpl.php for D6). The outline of the process should be as described below:


Hide the field at the top of your template file (you will render it later on if the user did not apply for the specific job).
Check if the user has already created an application node that references to the current posting. 


The first step can be easily implemented by writing something along the lines of:

hide($content['YOUR_FIELD_NAME']);


at the top of your template file. Use a dpm($content); first to make sure that you are hiding the right field.

The second step is a bit trickier. The most elegant way that comes to mind is to use the Corresponding Node References module so that when you create a reference from the application to the posting, a corresponding reference from the posting to the application is also created (this can also be useful if you want to show all the applications that were created for a specific posting in the posting's page). 

After you have "linked" the posting and the application with CNR, all you need to do is check if the author of the other postings is the logged in user. Specifically, you can use the node reference array in the $node object to get the referencing applications with node_load_multiple and then with a foreach loop compare each $node-&gt;uid against the uid of the logged in user. 

There is a blog post in Drutácora that describes a similar process and includes relevant code snippets (it's not in English but you should get the basic idea from the code).