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

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

Recommended Posts

  • Newbies
Posted

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.

Posted

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

Posted

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

  • Newbies
Posted

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.

  • Newbies
Posted

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?

Posted

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

This topic is 4290 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.