CRM.FindRecord issue?

I inadvertently posted this in Sage 300, so I am reposting it here.

Help please!  Not sure if I cannot see the forest for the trees on this one or if there is something missing on the server.

I typically never have an issue updating the value of a field through an asp page.  However, for some reason, the update has stopped working and I am not sure why.  This happened in March as well and it seemed to resolve itself after a few days without any changes to the page.  Therefore, I am assuming something changed on the server, but I am not sure what as this page has been in production for over a year.

The version is Sage CRM 2018 R3

The page is really simple, it is meant to update the value of a field if a button is clicked.

This is the message that I get when clicking the button...

Microsoft JScript runtime error '800a01b6'

Object doesn't support this property or method

/CRM/CustomPages/CSS/ReadyBtn.asp, line 32

This is the line that is producing the error

EntityRecord.cust_approved4insert = "Ready";

This is the complete script

var strEntity = "MyCustomEntity";
//Get the primary key of the entity in context; for this page it is the MyCustomEntity
var EntityID = Request.QueryString("Key58");

//Find your record in "Context"
var EntityRecord = CRM.FindRecord("MyCustomEntity", "cust_entityid="+EntityID);
//Update the record
EntityRecord.cust_approved4insert = "Ready";
EntityRecord.SaveChanges();

Is there something wrong with the above script and I am just not seeing it?

Any assistance would be greatly appreciated!  Thank you!!!

Parents
  • 0

    That looks OK to me.  There is another way of addressing the field and that is like

    EntityRecord("cust_approved4insert") = "Ready";

    I have made the assumption that the field does exist?

  • 0 in reply to Sage CRM

    Thanks!  It does exist :-)  The weird thing is that it has been working for over a year and now it is not.  So weird.  I am going to do an online walk through with a user this afternoon to see if they get the same error message.  I am wondering if something with my permissions got changed.

    Thanks for letting me know the script looks good.  I will try your other method as well.

    Thank you!!!!

Reply
  • 0 in reply to Sage CRM

    Thanks!  It does exist :-)  The weird thing is that it has been working for over a year and now it is not.  So weird.  I am going to do an online walk through with a user this afternoon to see if they get the same error message.  I am wondering if something with my permissions got changed.

    Thanks for letting me know the script looks good.  I will try your other method as well.

    Thank you!!!!

Children