zab Posted September 15, 2009 Posted September 15, 2009 Hello I have a portal that can be access from a menu on top of it, wich display different categories (to sort the items). In each categories I can add items into the portal using a script. I do not want to allow the creation of records from the portal. I prefer a script because it goes to the related LineItem to get some variable and sets some fields first. Everything goes very well except when the portal is empty. Then I can't get last field information (of course) and I can't find the right way to tell the script something like: if the portal is empty just create a new record in the lineItem. In other words: -my script goes to the last portal row and collect some variables. -it goes to the line item, create a new record and sets a few fields with those variables. -Back to the portal and a New window opens with the last item and present what's in there for verification and completion of the items qty, details etc... How can I tell my script if the portal is empty just create a new record or ELSE do the working script? I'M LOST. PLEASE HELP Thank you.
mfrapp Posted September 15, 2009 Posted September 15, 2009 If Count(Related::field) > 0 //not empty else //empty endif does this help?
Vaughan Posted September 15, 2009 Posted September 15, 2009 IsEmpty() is supposedly better optimised than Count() when checking for related records. If [ not IsEmpty( related::field ) ]
zab Posted September 16, 2009 Author Posted September 16, 2009 I tried "is empty" but because I can't (and don't want to) create new record from the portal it seems I can't select a field for the empty calc. And its the same for the count. Any other idea?
Recommended Posts
This topic is 5604 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 accountSign in
Already have an account? Sign in here.
Sign In Now