Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4443 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

hi,

I an new to scripting. I have made a this script myself. Script does execute fine. But there is one little problem with it. At some specific point it does not assigns value to the field. I don't know why. I am attaching the image of my script. Because i don't know how to export it in TEXT format. I am highlighting the part that suppose to assign a value in the field.

post-106853-0-73032700-1348432664_thumb.

post-106853-0-23301400-1348432666_thumb.

Posted

Hi!

I believe you need to add a Commit Record/Request immediately before the Delete Record. It has caught me before. You cannot delete a parent if it has a current child still active (as in your situation).

Posted

Hi!

I believe you need to add a Commit Record/Request immediately before the Delete Record. It has caught me before. You cannot delete a parent if it has a current child still active (as in your situation).

But i am not trying to delete the Parent Record. I am in Sale Detail table. Which is child of Sale Table and i am deleting it in Sale Detail.

In the box i have highlighted. The second last command set variable. it does not assign value in Product Tables Stock field. Although i have debugged the script the variable contains my required value, It is not assigned to the Stock Field! Why?

Posted (edited)

I understand ... but by parent, I mean you are trying to delete the record you are currently on. But it cannot set that related record with a value if ITS parent does not exist and FM therefore will not allow that related Set Field[]. Did you try the Commit?

EDIT LATER ... it would probably be clearer if I said that, it isn't that FM stops the Set Field[], but since there is no commit before deleting the 'parent', it reverts it.

Edited by LaRetta
Posted

I understand ... but by parent, I mean you are trying to delete the record you are currently on. But it cannot set that related record with a value if ITS parent does not exist and FM therefore will not allow that related Set Field[]. Did you try the Commit?

thanks bro, you just saved my 50$. Thank you very much. :laugh:

Posted

It's a bit of a tricky-wicket because you would think that, by deleting the child's parent, that WOULD be a commit in its purest sense, LOL. I LOVE having these kinds of things happen to me because they stick very deep (although sometimes painfully).

I will NEVER forget how to use 'Do not evaluate if all referenced fields are empty' for that very reason.

This topic is 4443 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.