Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

"If and if" statement script please help

Featured Replies

  • Newbies

I am a beginner for scripting and I like to do a multiple if statement script like: if "this=x" and "this=y" then "result=z"

please find the attached picture of my script. I tryed to do that but it isn't working. Maybe only missed some ( [ ] ) mark or something?

Could somebody fix my code or suggest a different solution?

Thank you

Gabor 

post-108329-0-04781500-1361794873_thumb.

Nowhere in your script do you set a value for the local variable $quantity

In addition to $quantity not being defined, why are the last two Else If conditions separate, since they both do exactly the same thing?

I think you are trying to say --- If X is true AND Y is true do something but if ONLY X is true then do something else:

 

If X is true and Y is true; do something;

Else if X is true and Y is not true; do something else;

 

This (the Y being not true) could be as simple as the status field NOT equal to whatever it is equal to in the first statement.

 

hth,

Martie

  • Author
  • Newbies

Hi thanks for the answers. Sorry I forget to remove the last line.

It is a script when I push a "Commit from invetory" button in an invoice then it removes the quantities from the related product stock, then locks the line items on the invoice (I can't modify after this)

When I push the "Revert Inventory" button then change everything back. This works perfectly but I like to extend this script to the replacement extension. I mean if the invoice status is replacement then when I push the "Commit from inventory"button then add the quantites to the Ammount_Faulty field on the related product as well. 

The main thing is the first line.

That formula doesn't work, I don't know the right way, because I am not a programer.

How can I define like

 

If Get (ScriptParameter) = "commit" and T12_INVOICES::Status="Replacement"

 

Sorry for my language I hope somebody understand what am I want.

Tanks

Gabor

 

post-108329-0-46819200-1361809981_thumb.

post-108329-0-13774700-1361810101_thumb.

  • Author
  • Newbies

Sorry, this is only part of the full script.

MartieH yes you right. But my formula on the first attachment doesn't work. Maybe I missed semicolons (;) or brackets. Could you please help?

Hi thanks for the answers. Sorry I forget to remove the last line.

It is a script when I push a "Commit from invetory" button in an invoice then it removes the quantities from the related product stock, then locks the line items on the invoice (I can't modify after this)

When I push the "Revert Inventory" button then change everything back. This works perfectly but I like to extend this script to the replacement extension. I mean if the invoice status is replacement then when I push the "Commit from inventory"button then add the quantites to the Ammount_Faulty field on the related product as well. 

The main thing is the first line.

That formula doesn't work, I don't know the right way, because I am not a programer.

How can I define like

 

If Get (ScriptParameter) = "commit" and T12_INVOICES::Status="Replacement"

 

Sorry for my language I hope somebody understand what am I want.

Tanks

Gabor

 

Does your commit button send in the script parameter?

post-82772-0-65636000-1361977048_thumb.p

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.