Is it possible to get "sys_created_on" value from within client script?

Nisar2
Mega Guru

Hi,

I've a requirement where in I need to compare a date with the record's created date and make sure it is not before/earlier than that.

For this, I'm using the "onChange" trigger set on the date field and I was wondering if it would be possible to get hold of the created date within the script?

One approach that I can think of is using GlideAjax to call a server script include and query the database by passing the "g_form.getUniqueValue()" value to the function. Then as a response, I can return the value back to the client. However, I was hoping if I can avoid going through all that for a single value.

 

Another approach is to use a "display" business rule to make use of "g_scratchpad" and send that value to the client. But again, this will involve the use of an additional business rule. 

Any other alternatives/suggestions?

 

PS: The "Created" date is not present on the form and I do not have permissions to change the form layout.

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

If you want to use client script then its mandatory that it should be on form. But now in this case its not on form.


So we are left with either BR or GlideAjax.

So pleaase use them and its a recommended best practice.

Thanks,
Ashutosh Munot

View solution in original post

5 REPLIES 5

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

If you want to use client script then its mandatory that it should be on form. But now in this case its not on form.


So we are left with either BR or GlideAjax.

So pleaase use them and its a recommended best practice.

Thanks,
Ashutosh Munot